com php-src: Move libxml_destroy_fci to RSHUTDOWN: ext/libxml/libxml.c ext/libxml/tests/libxml_set_externa l_entity_loader_basic.phpt
| From: | Dmitry Stogov | Date: | Thu, 17 Apr 2014 22:15:13 +0000 |
| Subject: | com php-src: Move libxml_destroy_fci to RSHUTDOWN: ext/libxml/libxml.c ext/libxml/tests/libxml_set_externa l_entity_loader_basic.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-77345@lists.php.net to get a copy of this message | ||
Commit: c3c47c431ea301f8750dbdd1ced69a6cf365b3a1
Author: Nikita Popov <nikic@php.net> Fri, 18 Apr 2014 00:03:38 +0200
Parents: 59d45e69f4a24935719230cea3d25a0c9701511e
Branches: phpng
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c3c47c431ea301f8750dbdd1ced69a6cf365b3a1
Log:
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...
Changed paths:
M ext/libxml/libxml.c
M ext/libxml/tests/libxml_set_external_entity_loader_basic.phpt
Diff:
diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c
index d399f72..af87213 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;
}
diff --git a/ext/libxml/tests/libxml_set_external_entity_loader_basic.phpt
b/ext/libxml/tests/libxml_set_external_entity_loader_basic.phpt
index 51ab777..938229f 100644
--- a/ext/libxml/tests/libxml_set_external_entity_loader_basic.phpt
+++ b/ext/libxml/tests/libxml_set_external_entity_loader_basic.phpt
@@ -31,6 +31,7 @@ var_dump($dd->validate());
echo "Done.\n";
+?>
--EXPECT--
string(10) "-//FOO/BAR"
string(25) "http://example.com/foobar"