diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2020-01-15 23:04:03 +0100 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2020-01-23 11:47:20 +0100 |
commit | 4130fe437a5db7ead1444d3748bd0fbad9829cb2 (patch) | |
tree | 02df4072419c04cab5695f0b9bf369041a286c2b /ext/libxml/libxml.c | |
parent | 984d508825cc5ae8eaad2e74bafa573d6706f6ff (diff) | |
download | php-git-4130fe437a5db7ead1444d3748bd0fbad9829cb2.tar.gz |
Make MSVCRT memory leak checking usable for the test suite
While basic support for MSVCRT debugging has been added long
ago[1], the leak checking is not usable for the test suite, because we
are no longer calling `xmlCleanupParser()` on RSHUTDOWN of
ext/libxml[2], and therefore a few bogus leaks are reported whenever
ext/libxml is unloaded.
We therefore ignore memory leaks for this case. We introduce
`ZEND_IGNORE_LEAKS_BEGIN()` and `ZEND_IGNORE_LEAKS_END()` to keep
those ignores better readable, and also because these *might* be
useful for other leak checkers as well.
We also explicitly free the `zend_handlers_table` and the `p5s` to
avoid spurious leak reports.
[1] <http://git.php.net/?p=php-src.git;a=commit;h=d756e1db2324c1f4ab6f9b52e329959ce6a02bc3>
[2] <http://git.php.net/?p=php-src.git;a=commit;h=8742276eb3905eb97a585417000c7b8df85006d4>
Diffstat (limited to 'ext/libxml/libxml.c')
-rw-r--r-- | ext/libxml/libxml.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c index 333dab4856..360d1999e7 100644 --- a/ext/libxml/libxml.c +++ b/ext/libxml/libxml.c @@ -752,7 +752,9 @@ PHP_LIBXML_API void php_libxml_initialize(void) { if (!_php_libxml_initialized) { /* we should be the only one's to ever init!! */ + ZEND_IGNORE_LEAKS_BEGIN(); xmlInitParser(); + ZEND_IGNORE_LEAKS_END(); _php_libxml_default_entity_loader = xmlGetExternalEntityLoader(); xmlSetExternalEntityLoader(_php_libxml_pre_ext_ent_loader); |