Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_objects.c
| From: | Marcus Boerger | Date: | Sun, 07 Mar 2004 16:04:05 +0000 |
| Subject: | Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_objects.c | ||
| References: | 1 | Groups: | php.zend-engine.cvs |
| Request: | Send a blank email to php-zend-engine-cvs+get-2451@lists.php.net to get a copy of this message | ||
Hello Andi,
disallowing exception in dtors is one thing that's fine with me. But
it must either result in a fatal error or the exception being displayed
directly.
Monday, March 1, 2004, 8:45:08 PM, you wrote:
> 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;
> + }
> }
> }
--
Best regards,
Marcus mailto:helly@php.net