dmitry                                   Mon, 04 Oct 2010 07:15:30 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=303971

Log:
- Fixed bug #52773 (Proxy objects have an inadequate destroy_object store 
callback)
- Fixed bug #52774 (Proxy object's store free callback calls zval_ptor_dtor on 
already freed data)

Bugs: http://bugs.php.net/52773 (Assigned) Proxy objects have an inadequate 
destroy_object store callback
      http://bugs.php.net/52774 (Assigned) Proxy object's store free callback 
calls zval_ptor_dtor on already freed data
      
Changed paths:
    U   php/php-src/trunk/Zend/zend_objects_API.c

Modified: php/php-src/trunk/Zend/zend_objects_API.c
===================================================================
--- php/php-src/trunk/Zend/zend_objects_API.c   2010-10-04 01:27:33 UTC (rev 
303970)
+++ php/php-src/trunk/Zend/zend_objects_API.c   2010-10-04 07:15:30 UTC (rev 
303971)
@@ -314,6 +314,10 @@

 static zend_object_handlers zend_object_proxy_handlers;

+ZEND_API void zend_objects_proxy_destroy(zend_object *object, 
zend_object_handle handle TSRMLS_DC)
+{
+}
+
 ZEND_API void zend_objects_proxy_free_storage(zend_proxy_object *object 
TSRMLS_DC)
 {
        zval_ptr_dtor(&object->object);
@@ -336,13 +340,14 @@
        zval *retval;

        pobj->object = object;
-       pobj->property = member;
-       zval_add_ref(&pobj->property);
        zval_add_ref(&pobj->object);
+       ALLOC_ZVAL(pobj->property);
+       INIT_PZVAL_COPY(pobj->property, member);
+       zval_copy_ctor(pobj->property);

        MAKE_STD_ZVAL(retval);
        Z_TYPE_P(retval) = IS_OBJECT;
-       Z_OBJ_HANDLE_P(retval) = zend_objects_store_put(pobj, NULL, 
(zend_objects_free_object_storage_t) zend_objects_proxy_free_storage, 
(zend_objects_store_clone_t) zend_objects_proxy_clone TSRMLS_CC);
+       Z_OBJ_HANDLE_P(retval) = zend_objects_store_put(pobj, 
(zend_objects_store_dtor_t)zend_objects_proxy_destroy, 
(zend_objects_free_object_storage_t) zend_objects_proxy_free_storage, 
(zend_objects_store_clone_t) zend_objects_proxy_clone TSRMLS_CC);
        Z_OBJ_HT_P(retval) = &zend_object_proxy_handlers;

        return retval;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to