diff options
| author | Nuno Lopes <nlopess@php.net> | 2007-04-04 14:24:03 +0000 |
|---|---|---|
| committer | Nuno Lopes <nlopess@php.net> | 2007-04-04 14:24:03 +0000 |
| commit | 5833fc40dcc6cabcc257edbc7131fac03b2e9042 (patch) | |
| tree | afa3805bf64992bec01352d2b24937478dc9332c /ext | |
| parent | 539be2cc816d4e12950594458d4e012c5650cc51 (diff) | |
| download | php-git-5833fc40dcc6cabcc257edbc7131fac03b2e9042.tar.gz | |
fix race condition on font cache shutdown
Diffstat (limited to 'ext')
| -rw-r--r-- | ext/gd/libgd/gdft.c | 6 |
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() |
