From: Nuno Lopes Date: Wed, 4 Apr 2007 14:26:04 +0000 (+0000) Subject: MFB: fix race condition on font cache shutdown X-Git-Tag: RELEASE_1_1_0~63 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5e50336e7ede22fa632e9796137105a2302306f2;p=php MFB: fix race condition on font cache shutdown --- diff --git a/ext/gd/libgd/gdft.c b/ext/gd/libgd/gdft.c index 414f5e28eb..5ddddcea5e 100644 --- a/ext/gd/libgd/gdft.c +++ b/ext/gd/libgd/gdft.c @@ -715,13 +715,15 @@ gdroundupdown (FT_F26Dot6 v1, int updown) void gdFontCacheShutdown() { + gdMutexLock(gdFontCacheMutex); + if (fontCache) { - gdMutexLock(gdFontCacheMutex); gdCacheDelete(fontCache); fontCache = NULL; - gdMutexUnlock(gdFontCacheMutex); FT_Done_FreeType(library); } + + gdMutexUnlock(gdFontCacheMutex); } void gdFreeFontCache()