From: Nuno Lopes Date: Wed, 4 Apr 2007 14:24:03 +0000 (+0000) Subject: fix race condition on font cache shutdown X-Git-Tag: php-5.2.2RC1~53 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5833fc40dcc6cabcc257edbc7131fac03b2e9042;p=php 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()