cvs: ZendEngine2 / zend_objects.c

From: Date: Mon, 01 Mar 2004 19:45:08 +0000
Subject: cvs: ZendEngine2 / zend_objects.c
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-2433@lists.php.net to get a copy of this message
andi Mon Mar 1 14:45:08 2004 EDT Modified files: /ZendEngine2 zend_objects.c Log: - Fix crash in destructors(). You can't throw an exception in destructors as there is no guaranteed time when the destructor will be called. http://cvs.php.net/diff.php/ZendEngine2/zend_objects.c?r1=1.45&r2=1.46&ty=u Index: ZendEngine2/zend_objects.c diff -u ZendEngine2/zend_objects.c:1.45 ZendEngine2/zend_objects.c:1.46 --- ZendEngine2/zend_objects.c:1.45 Wed Feb 4 06:56:07 2004 +++ ZendEngine2/zend_objects.c Mon Mar 1 14:45:07 2004 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_objects.c,v 1.45 2004/02/04 11:56:07 zeev Exp $ */ +/* $Id: zend_objects.c,v 1.46 2004/03/01 19:45:07 andi Exp $ */ #include "zend.h" #include "zend_globals.h" @@ -68,7 +68,15 @@ zobj.value.obj.handlers = &std_object_handlers; INIT_PZVAL(obj); + if (EG(exception)) { + zval_ptr_dtor(&EG(exception)); + EG(exception) = NULL; + } zend_call_method_with_0_params(&obj, object->ce, NULL, "__destruct", NULL); + if (EG(exception)) { + zval_ptr_dtor(&EG(exception)); + EG(exception) = NULL; + } } }

« previous php.zend-engine.cvs (#2433) next »