From 4124672edfa44dc5585122fd2ef9650817206e14 Mon Sep 17 00:00:00 2001 From: Moriyoshi Koizumi Date: Sat, 23 Nov 2002 22:11:59 +0000 Subject: [PATCH] Fixed leaks. Other leaks are originated in libgd. --- ext/gd/gd.c | 13 ++++++++++++- ext/gd/php_gd.h | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ext/gd/gd.c b/ext/gd/gd.c index f2bee0bd45..6984b351a0 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -320,7 +320,7 @@ zend_module_entry gd_module_entry = { PHP_MINIT(gd), NULL, NULL, - NULL, + PHP_RSHUTDOWN(gd), PHP_MINFO(gd), NO_VERSION_YET, STANDARD_MODULE_PROPERTIES @@ -412,6 +412,17 @@ PHP_MINIT_FUNCTION(gd) } /* }}} */ +/* {{{ PHP_RSHUTDOWN_FUNCTION + */ +PHP_RSHUTDOWN_FUNCTION(gd) +{ +#if HAVE_LIBGD20 + gdFreeFontCache(); +#endif + return SUCCESS; +} +/* }}} */ + /* {{{ PHP_MINFO_FUNCTION */ PHP_MINFO_FUNCTION(gd) diff --git a/ext/gd/php_gd.h b/ext/gd/php_gd.h index b42a34da9a..0ac89c2a38 100644 --- a/ext/gd/php_gd.h +++ b/ext/gd/php_gd.h @@ -58,6 +58,7 @@ extern zend_module_entry gd_module_entry; PHP_MINFO_FUNCTION(gd); PHP_MINIT_FUNCTION(gd); PHP_MSHUTDOWN_FUNCTION(gd); +PHP_RSHUTDOWN_FUNCTION(gd); PHP_FUNCTION(gd_info); PHP_FUNCTION(imagearc); -- 2.50.1