summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Zend/tests/gc_034.phpt11
-rw-r--r--Zend/zend.c4
2 files changed, 13 insertions, 2 deletions
diff --git a/Zend/tests/gc_034.phpt b/Zend/tests/gc_034.phpt
new file mode 100644
index 0000000000..29f7aae9ca
--- /dev/null
+++ b/Zend/tests/gc_034.phpt
@@ -0,0 +1,11 @@
+--TEST--
+GC 033: GC in request shutdown and resource list destroy
+--FILE--
+<?php
+/* run with valgrind */
+$a = array(fopen(__FILE__, 'r'));
+$a[] = &$a;
+?>
+==DONE==
+--EXPECT--
+==DONE==
diff --git a/Zend/zend.c b/Zend/zend.c
index b7a8784a69..b1177eda5a 100644
--- a/Zend/zend.c
+++ b/Zend/zend.c
@@ -898,14 +898,14 @@ ZEND_API void zend_deactivate(void) /* {{{ */
shutdown_compiler();
} zend_end_try();
- zend_destroy_rsrc_list(&EG(regular_list));
-
#if ZEND_DEBUG
if (GC_G(gc_enabled) && !CG(unclean_shutdown)) {
gc_collect_cycles();
}
#endif
+ zend_destroy_rsrc_list(&EG(regular_list));
+
#if GC_BENCH
fprintf(stderr, "GC Statistics\n");
fprintf(stderr, "-------------\n");