cvs: ZendEngine2 / zend_execute_API.c zend_objects_API.c zend_objects_API.h
| From: | Stanislav Malyshev | Date: | Fri, 17 Sep 2004 10:13:52 +0000 |
| Subject: | cvs: ZendEngine2 / zend_execute_API.c zend_objects_API.c zend_objects_API.h | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-2988@lists.php.net to get a copy of this message | ||
stas Fri Sep 17 06:13:52 2004 EDT
Modified files:
/ZendEngine2 zend_execute_API.c zend_objects_API.c
zend_objects_API.h
Log:
fix crash when dtor is fialing on shutdown
http://cvs.php.net/diff.php/ZendEngine2/zend_execute_API.c?r1=1.295&r2=1.296&ty=u
Index: ZendEngine2/zend_execute_API.c
diff -u ZendEngine2/zend_execute_API.c:1.295 ZendEngine2/zend_execute_API.c:1.296
--- ZendEngine2/zend_execute_API.c:1.295 Thu Sep 9 12:47:22 2004
+++ ZendEngine2/zend_execute_API.c Fri Sep 17 06:13:52 2004
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_execute_API.c,v 1.295 2004/09/09 16:47:22 andi Exp $ */
+/* $Id: zend_execute_API.c,v 1.296 2004/09/17 10:13:52 stas Exp $ */
#include <stdio.h>
#include <signal.h>
@@ -190,6 +190,9 @@
void shutdown_destructors(TSRMLS_D) {
zend_try {
zend_objects_store_call_destructors(&EG(objects_store) TSRMLS_CC);
+ } 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();
}
http://cvs.php.net/diff.php/ZendEngine2/zend_objects_API.c?r1=1.42&r2=1.43&ty=u
Index: ZendEngine2/zend_objects_API.c
diff -u ZendEngine2/zend_objects_API.c:1.42 ZendEngine2/zend_objects_API.c:1.43
--- ZendEngine2/zend_objects_API.c:1.42 Sun Jul 25 13:25:44 2004
+++ ZendEngine2/zend_objects_API.c Fri Sep 17 06:13:52 2004
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_objects_API.c,v 1.42 2004/07/25 17:25:44 helly Exp $ */
+/* $Id: zend_objects_API.c,v 1.43 2004/09/17 10:13:52 stas Exp $ */
#include "zend.h"
#include "zend_globals.h"
@@ -58,6 +58,16 @@
}
}
+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)
{
http://cvs.php.net/diff.php/ZendEngine2/zend_objects_API.h?r1=1.15&r2=1.16&ty=u
Index: ZendEngine2/zend_objects_API.h
diff -u ZendEngine2/zend_objects_API.h:1.15 ZendEngine2/zend_objects_API.h:1.16
--- ZendEngine2/zend_objects_API.h:1.15 Sun Jul 25 13:25:44 2004
+++ ZendEngine2/zend_objects_API.h Fri Sep 17 06:13:52 2004
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_objects_API.h,v 1.15 2004/07/25 17:25:44 helly Exp $ */
+/* $Id: zend_objects_API.h,v 1.16 2004/09/17 10:13:52 stas Exp $ */
#ifndef ZEND_OBJECTS_API_H
#define ZEND_OBJECTS_API_H
@@ -57,6 +57,7 @@
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 */