nlopess         Wed Apr  4 14:26:04 2007 UTC

  Modified files:              
    /php-src/ext/gd/libgd       gdft.c 
  Log:
  MFB: fix race condition on font cache shutdown
  
http://cvs.php.net/viewvc.cgi/php-src/ext/gd/libgd/gdft.c?r1=1.43&r2=1.44&diff_format=u
Index: php-src/ext/gd/libgd/gdft.c
diff -u php-src/ext/gd/libgd/gdft.c:1.43 php-src/ext/gd/libgd/gdft.c:1.44
--- php-src/ext/gd/libgd/gdft.c:1.43    Wed Apr  4 00:44:38 2007
+++ php-src/ext/gd/libgd/gdft.c Wed Apr  4 14:26:04 2007
@@ -715,13 +715,15 @@
 
 void gdFontCacheShutdown()
 {
+       gdMutexLock(gdFontCacheMutex);
+
        if (fontCache) {
-               gdMutexLock(gdFontCacheMutex);
                gdCacheDelete(fontCache);
                fontCache = NULL;
-               gdMutexUnlock(gdFontCacheMutex);
                FT_Done_FreeType(library);
        }
+
+       gdMutexUnlock(gdFontCacheMutex);
 }
 
 void gdFreeFontCache()

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to