summaryrefslogtreecommitdiff
path: root/ext/libxml/libxml.c
diff options
context:
space:
mode:
authorNikita Popov <nikic@php.net>2014-04-18 00:03:38 +0200
committerNikita Popov <nikic@php.net>2014-04-18 00:15:13 +0200
commitc3c47c431ea301f8750dbdd1ced69a6cf365b3a1 (patch)
tree686c27eef2b88a5434b08a2a6626c38c3f99a64c /ext/libxml/libxml.c
parent59d45e69f4a24935719230cea3d25a0c9701511e (diff)
downloadphp-git-c3c47c431ea301f8750dbdd1ced69a6cf365b3a1.tar.gz
Move libxml_destroy_fci to RSHUTDOWN
If this is only done in post shutdown and the function name is an object (e.g. closure), the object will already be freed during zend_deactivate. I left the rest of the shutdown procedure in post shutdown, as it presumably has a reason to be there...
Diffstat (limited to 'ext/libxml/libxml.c')
-rw-r--r--ext/libxml/libxml.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c
index d399f72b95..af87213a39 100644
--- a/ext/libxml/libxml.c
+++ b/ext/libxml/libxml.c
@@ -86,6 +86,7 @@ ZEND_GET_MODULE(libxml)
/* {{{ function prototypes */
static PHP_MINIT_FUNCTION(libxml);
static PHP_RINIT_FUNCTION(libxml);
+static PHP_RSHUTDOWN_FUNCTION(libxml);
static PHP_MSHUTDOWN_FUNCTION(libxml);
static PHP_MINFO_FUNCTION(libxml);
static int php_libxml_post_deactivate();
@@ -138,7 +139,7 @@ zend_module_entry libxml_module_entry = {
PHP_MINIT(libxml), /* extension-wide startup function */
PHP_MSHUTDOWN(libxml), /* extension-wide shutdown function */
PHP_RINIT(libxml), /* per-request startup function */
- NULL, /* per-request shutdown function */
+ PHP_RSHUTDOWN(libxml), /* per-request shutdown function */
PHP_MINFO(libxml), /* information function */
NO_VERSION_YET,
PHP_MODULE_GLOBALS(libxml), /* globals descriptor */
@@ -862,6 +863,12 @@ static PHP_RINIT_FUNCTION(libxml)
return SUCCESS;
}
+static PHP_RSHUTDOWN_FUNCTION(libxml)
+{
+ _php_libxml_destroy_fci(&LIBXML(entity_loader).fci, &LIBXML(entity_loader).object);
+
+ return SUCCESS;
+}
static PHP_MSHUTDOWN_FUNCTION(libxml)
{
@@ -898,8 +905,6 @@ static int php_libxml_post_deactivate()
}
xmlResetLastError();
- _php_libxml_destroy_fci(&LIBXML(entity_loader).fci, &LIBXML(entity_loader).object);
-
return SUCCESS;
}