From b5e6c78edadd216edd1d80ac9acd273fe3e13340 Mon Sep 17 00:00:00 2001 From: Pierre Joye Date: Fri, 23 Feb 2007 00:58:49 +0000 Subject: [PATCH] - #40578, fix the 2nd race condition on shutdown when the cache is freed --- NEWS | 2 +- ext/gd/libgd/gdft.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 1a18c5365f7..4fddb3d4a30 100644 --- a/NEWS +++ b/NEWS @@ -9,7 +9,7 @@ PHP NEWS - Added --ri switch to CLI which allows to check extension information. (Marcus) - Added tidyNode::getParent() method (John, Nuno) - Fixed zend_llist_remove_tail (Michael Wallner, Dmitry) -- Fixed bug #40578 (imagettftext() multithreading issue). (Tony) +- Fixed bug #40578 (imagettftext() multithreading issue). (Tony, Pierre) - Fixed bug #40576 (double values are truncated to 6 decimal digits when encoding). (Tony) - Fixed bug #40560 (DIR functions do not work on root UNC path). (Dmitry) diff --git a/ext/gd/libgd/gdft.c b/ext/gd/libgd/gdft.c index bf5bd04d12e..25974528af8 100644 --- a/ext/gd/libgd/gdft.c +++ b/ext/gd/libgd/gdft.c @@ -718,9 +718,10 @@ gdroundupdown (FT_F26Dot6 v1, int updown) void gdFontCacheShutdown() { if (fontCache) { - gdMutexShutdown(gdFontCacheMutex); + gdMutexLock(gdFontCacheMutex); gdCacheDelete(fontCache); fontCache = NULL; + gdMutexShutdown(gdFontCacheMutex); FT_Done_FreeType(library); } }