summaryrefslogtreecommitdiff
path: root/ext/gd
diff options
context:
space:
mode:
authorNuno Lopes <nlopess@php.net>2007-04-04 14:24:03 +0000
committerNuno Lopes <nlopess@php.net>2007-04-04 14:24:03 +0000
commit5833fc40dcc6cabcc257edbc7131fac03b2e9042 (patch)
treeafa3805bf64992bec01352d2b24937478dc9332c /ext/gd
parent539be2cc816d4e12950594458d4e012c5650cc51 (diff)
downloadphp-git-5833fc40dcc6cabcc257edbc7131fac03b2e9042.tar.gz
fix race condition on font cache shutdown
Diffstat (limited to 'ext/gd')
-rw-r--r--ext/gd/libgd/gdft.c6
1 files changed, 4 insertions, 2 deletions
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()