]> granicus.if.org Git - php/commitdiff
MFH destructor failure fix
authorStanislav Malyshev <stas@php.net>
Fri, 17 Sep 2004 10:19:47 +0000 (10:19 +0000)
committerStanislav Malyshev <stas@php.net>
Fri, 17 Sep 2004 10:19:47 +0000 (10:19 +0000)
Zend/zend_execute_API.c
Zend/zend_objects_API.c
Zend/zend_objects_API.h

index d0670314cc5093e149dc3dd129a99758a659e65f..73404e29fc1bfd9a9e13bf13fc07d8d840b2a715 100644 (file)
@@ -208,6 +208,9 @@ void shutdown_executor(TSRMLS_D)
                zend_llist_apply(&zend_extensions, (llist_apply_func_t) zend_extension_deactivator TSRMLS_CC);
                zend_objects_store_call_destructors(&EG(objects_store) TSRMLS_CC);
                zend_hash_graceful_reverse_destroy(&EG(symbol_table));
+       } zend_catch {
+               /* if we couldn't destruct cleanly, mark all objects as destructed anyway */
+               zend_objects_store_mark_destructed(&EG(objects_store) TSRMLS_CC);
        } zend_end_try();
 
        zend_try {
index 33225da4dbd457910bd7aca6d23c3256ce59c5da..6aa2d80b5684a3c1e68b17e5b2d4f028edeb18e7 100644 (file)
@@ -58,6 +58,16 @@ ZEND_API void zend_objects_store_call_destructors(zend_objects_store *objects TS
        }
 }
 
+ZEND_API void zend_objects_store_mark_destructed(zend_objects_store *objects TSRMLS_DC)
+{
+       zend_uint i = 1;
+
+       for (i = 1; i < objects->top ; i++) {
+               if (objects->object_buckets[i].valid) {
+                       objects->object_buckets[i].destructor_called = 1;
+               }
+       }
+}
 
 ZEND_API void zend_objects_store_free_object_storage(zend_objects_store *objects TSRMLS_DC)
 {
index 189ab9c5ec2544ab6732a1adcfde46c97b735468..02701941f2d906357b3558978c02aa01fb96156a 100644 (file)
@@ -57,6 +57,7 @@ typedef struct _zend_objects_store {
 BEGIN_EXTERN_C()
 ZEND_API void zend_objects_store_init(zend_objects_store *objects, zend_uint init_size);
 ZEND_API void zend_objects_store_call_destructors(zend_objects_store *objects TSRMLS_DC);
+ZEND_API void zend_objects_store_mark_destructed(zend_objects_store *objects TSRMLS_DC);
 ZEND_API void zend_objects_store_destroy(zend_objects_store *objects);
 
 /* Store API functions */