From: Christoph M. Becker Date: Fri, 21 Jun 2019 11:50:19 +0000 (+0200) Subject: Properly shut down font cache mutex X-Git-Tag: php-7.4.0alpha2~13 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=eec5d2a25f75c3cacd07f8cb0f88ce3343641528;p=php Properly shut down font cache mutex Since the font cache mutex in set up in MINIT, we have to shut it down in MSHUTDOWN. --- diff --git a/ext/gd/gd.c b/ext/gd/gd.c index 96c0e23edf..c3d31c8e1a 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -1029,7 +1029,7 @@ zend_module_entry gd_module_entry = { "gd", gd_functions, PHP_MINIT(gd), - NULL, + PHP_MSHUTDOWN(gd), NULL, #if HAVE_GD_FREETYPE && HAVE_LIBFREETYPE PHP_RSHUTDOWN(gd), @@ -1238,6 +1238,17 @@ PHP_MINIT_FUNCTION(gd) } /* }}} */ +/* {{{ PHP_MSHUTDOWN_FUNCTION + */ +PHP_MSHUTDOWN_FUNCTION(gd) +{ +#if HAVE_GD_BUNDLED && HAVE_LIBFREETYPE + gdFontCacheMutexShutdown(); +#endif + return SUCCESS; +} +/* }}} */ + /* {{{ PHP_RSHUTDOWN_FUNCTION */ #if HAVE_GD_FREETYPE && HAVE_LIBFREETYPE diff --git a/ext/gd/php_gd.h b/ext/gd/php_gd.h index e6db0c0ec0..a3e80cd3d0 100644 --- a/ext/gd/php_gd.h +++ b/ext/gd/php_gd.h @@ -83,6 +83,7 @@ extern zend_module_entry gd_module_entry; /* gd.c functions */ PHP_MINFO_FUNCTION(gd); PHP_MINIT_FUNCTION(gd); +PHP_MSHUTDOWN_FUNCTION(gd); #if HAVE_GD_FREETYPE && HAVE_LIBFREETYPE PHP_RSHUTDOWN_FUNCTION(gd); #endif