From: Nikita Popov Date: Wed, 29 Jul 2020 13:25:57 +0000 (+0200) Subject: Fix bug #79900 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c206c742d6225c7f4c7ffbf95e33034d8de59047;p=php Fix bug #79900 Run debug build shutdown GC regardless even if GC has been disabled. Of course, this only does something meaningful if the GC has been disabled at runtime and root collection is still enabled. We cannot prevent leaks if GC is disabled completely. --- diff --git a/Zend/tests/bug79900.phpt b/Zend/tests/bug79900.phpt new file mode 100644 index 0000000000..a09a72c74c --- /dev/null +++ b/Zend/tests/bug79900.phpt @@ -0,0 +1,13 @@ +--TEST-- +Bug #79900: Memory leaks reported if GC disabled at runtime +--FILE-- +obj = $obj; + +?> +===DONE=== +--EXPECT-- +===DONE=== diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 998eb495dc..e6f1e44fca 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -329,7 +329,7 @@ void shutdown_executor(void) /* {{{ */ zend_stack_clean(&EG(user_exception_handlers), (void (*)(void *))ZVAL_PTR_DTOR, 1); #if ZEND_DEBUG - if (gc_enabled() && !CG(unclean_shutdown)) { + if (!CG(unclean_shutdown)) { gc_collect_cycles(); } #endif