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.
--- /dev/null
+--TEST--
+Bug #79900: Memory leaks reported if GC disabled at runtime
+--FILE--
+<?php
+
+gc_disable();
+$obj = new stdClass;
+$obj->obj = $obj;
+
+?>
+===DONE===
+--EXPECT--
+===DONE===
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