diff --git a/ext/gd/gd.c b/ext/gd/gd.c index 266062856ab..943bdeb0df3 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -995,7 +995,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), @@ -1204,6 +1204,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 04652b7bc15..2b113647538 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