cvs: ZendEngine2(PHP_5_3) / zend_gc.c

[email protected] ("Dmitry Stogov")
Newsgroups php.zend-engine.cvs
Message-ID <cvsdmitry1203590534@cvsserver>
dmitry		Thu Feb 21 10:42:14 2008 UTC

  Modified files:              (Branch: PHP_5_3)
    /ZendEngine2	zend_gc.c 
  Log:
  Prevented recursive collector invocation
  
  
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_gc.c?r1=1.1.2.5&r2=1.1.2.6&diff_format=u
Index: ZendEngine2/zend_gc.c
diff -u ZendEngine2/zend_gc.c:1.1.2.5 ZendEngine2/zend_gc.c:1.1.2.6
--- ZendEngine2/zend_gc.c:1.1.2.5	Wed Feb 20 09:45:47 2008
+++ ZendEngine2/zend_gc.c	Thu Feb 21 10:42:14 2008
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_gc.c,v 1.1.2.5 2008/02/20 09:45:47 dmitry Exp $ */
+/* $Id: zend_gc.c,v 1.1.2.6 2008/02/21 10:42:14 dmitry Exp $ */
 
 #include "zend.h"
 #include "zend_API.h"
@@ -493,8 +493,8 @@
 		}
 		GC_G(gc_runs)++;
 		GC_G(zval_to_free) = NULL;
-		gc_mark_roots(TSRMLS_C);
 		GC_G(gc_active) = 1;
+		gc_mark_roots(TSRMLS_C);
 		gc_scan_roots(TSRMLS_C);
 		gc_collect_roots(TSRMLS_C);
 		GC_G(gc_active) = 0;
@@ -508,7 +508,9 @@
 					EG(objects_store).object_buckets[Z_OBJ_HANDLE(p->z)].valid &&
 					EG(objects_store).object_buckets[Z_OBJ_HANDLE(p->z)].bucket.obj.refcount <= 0) {
 					if (EXPECTED(Z_OBJ_HANDLER(p->z, get_properties) != NULL)) {
+						GC_G(gc_active) = 1;
 						Z_OBJPROP(p->z)->pDestructor = NULL;
+						GC_G(gc_active) = 0;
 					}
 					EG(objects_store).object_buckets[Z_OBJ_HANDLE(p->z)].bucket.obj.refcount = 1;
 					zend_objects_store_del_ref_by_handle(Z_OBJ_HANDLE(p->z) TSRMLS_CC);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.