Skip to content

Commit 7d437fe

Browse files
committed
- MFB: #40578, fix the 2nd race condition on shutdown when the cache is
freed
1 parent 65b54ba commit 7d437fe

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ext/gd/libgd/gdft.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -718,9 +718,10 @@ gdroundupdown (FT_F26Dot6 v1, int updown)
718718
void gdFontCacheShutdown()
719719
{
720720
if (fontCache) {
721-
gdMutexShutdown(gdFontCacheMutex);
721+
gdMutexLock(gdFontCacheMutex);
722722
gdCacheDelete(fontCache);
723723
fontCache = NULL;
724+
gdMutexShutdown(gdFontCacheMutex);
724725
FT_Done_FreeType(library);
725726
}
726727
}

0 commit comments

Comments
 (0)