summaryrefslogtreecommitdiff
path: root/ext/gd/gd.c
diff options
context:
space:
mode:
authorPierre Joye <pajoye@php.net>2007-04-04 00:47:55 +0000
committerPierre Joye <pajoye@php.net>2007-04-04 00:47:55 +0000
commit6ef9642b1669067068026d0528d99247f553689a (patch)
treefce2642447bd2a6792a1cde3caf31ff53bd041c6 /ext/gd/gd.c
parent17c0c49a54db2a5dd6dc2205d0e02978b3070bae (diff)
downloadphp-git-6ef9642b1669067068026d0528d99247f553689a.tar.gz
- MFH:
- remove double lock (tween colors cache is created in each thread, the cache mutex is already locked earlier) - #40858, other TS improvements for gd freetype cache management cache initialization and shutdown is now done in MINIT and MSHUTDOWN.
Diffstat (limited to 'ext/gd/gd.c')
-rw-r--r--ext/gd/gd.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/ext/gd/gd.c b/ext/gd/gd.c
index 56e0f9e405..f738863b74 100644
--- a/ext/gd/gd.c
+++ b/ext/gd/gd.c
@@ -1147,11 +1147,7 @@ zend_module_entry gd_module_entry = {
"gd",
gd_functions,
PHP_MINIT(gd),
-#if HAVE_LIBT1
PHP_MSHUTDOWN(gd),
-#else
- NULL,
-#endif
NULL,
#if HAVE_LIBGD20 && HAVE_GD_STRINGFT && (HAVE_GD_FONTCACHESHUTDOWN || HAVE_GD_FREEFONTCACHE)
PHP_RSHUTDOWN(gd),
@@ -1195,16 +1191,20 @@ static void php_free_gd_font(zend_rsrc_list_entry *rsrc TSRMLS_DC)
}
/* }}} */
-#if HAVE_LIBT1
+
/* {{{ PHP_MSHUTDOWN_FUNCTION
*/
PHP_MSHUTDOWN_FUNCTION(gd)
{
+#if HAVE_LIBT1
T1_CloseLib();
+#endif
+#if HAVE_GD_FONTMUTEX
+ gdFontCacheMutexShutdown();
+#endif
return SUCCESS;
}
/* }}} */
-#endif
/* {{{ PHP_MINIT_FUNCTION
@@ -1213,6 +1213,9 @@ PHP_MINIT_FUNCTION(gd)
{
le_gd = zend_register_list_destructors_ex(php_free_gd_image, NULL, "gd", module_number);
le_gd_font = zend_register_list_destructors_ex(php_free_gd_font, NULL, "gd font", module_number);
+#if HAVE_GD_FONTMUTEX
+ gdFontCacheMutexSetup();
+#endif
#if HAVE_LIBT1
T1_SetBitmapPad(8);
T1_InitLib(NO_LOGFILE | IGNORE_CONFIGFILE | IGNORE_FONTDATABASE);