com gtk/php-gtk: Use a dummy destructor for StyleHelper object to avoid crashes in ZE2.: ext/gtk+/php_gtk+_types.c

[email protected] (David Soria Parra) Thu, 12 Jan 2006 19:00:18 +0000
Newsgroups php.gtk.cvs
Message-ID <[email protected]>
Commit:    462ea561964b84ef80c0036c941c894ed4df73b1
Author:    Andrei Zmievski <[email protected]>         Thu, 12 Jan 2006 19:00:18 +0000
Parents:   bf76f9c728b2a173ed7ec28cee671f9babb25070
Branches:  master

Link:       http://git.php.net/?p=gtk/php-gtk.git;a=commitdiff;h=462ea561964b84ef80c0036c941c894ed4df73b1

Log:
Use a dummy destructor for StyleHelper object to avoid crashes in ZE2.

Changed paths:
  M  ext/gtk+/php_gtk+_types.c


Diff:
462ea561964b84ef80c0036c941c894ed4df73b1
diff --git a/ext/gtk+/php_gtk+_types.c b/ext/gtk+/php_gtk+_types.c
index 8110aab..e79b68c 100644
--- a/ext/gtk+/php_gtk+_types.c
+++ b/ext/gtk+/php_gtk+_types.c
@@ -355,6 +355,11 @@ static zend_object_handlers style_helper_handlers = {
 	style_helper_count_elements, /* count_elements */
 };
 
+void style_helper_destroy_object(zend_object *object, zend_object_handle handle TSRMLS_DC)
+{
+    /* dummy dtor to avoid crashes in ZE2 */
+}
+
 static void style_helper_free_storage(style_helper *sh TSRMLS_DC)
 {
     zend_hash_destroy(sh->properties);
@@ -379,7 +384,7 @@ PHP_GTK_API void phpg_create_style_helper(zval **zobj, GtkStyle *style, int type
     }
 	Z_TYPE_PP(zobj) = IS_OBJECT;
 
-	Z_OBJ_HANDLE_PP(zobj) = zend_objects_store_put(sh, NULL, (zend_objects_free_object_storage_t) style_helper_free_storage, NULL TSRMLS_CC);
+	Z_OBJ_HANDLE_PP(zobj) = zend_objects_store_put(sh, (zend_objects_store_dtor_t) style_helper_destroy_object, (zend_objects_free_object_storage_t) style_helper_free_storage, NULL TSRMLS_CC);
 	Z_OBJ_HT_PP(zobj) = &style_helper_handlers;
 }