Use free_obj for intl ResourceBundle

Partial fix for bug #67911, the part about __destruct() not being
called.
This commit is contained in:
Nikita Popov 2017-12-28 12:25:01 +01:00
parent bee5bc78ed
commit 3538cbe6c0

View File

@ -35,8 +35,8 @@ zend_class_entry *ResourceBundle_ce_ptr = NULL;
static zend_object_handlers ResourceBundle_object_handlers;
/* {{{ ResourceBundle_object_dtor */
static void ResourceBundle_object_destroy( zend_object *object )
/* {{{ ResourceBundle_object_free */
static void ResourceBundle_object_free( zend_object *object )
{
ResourceBundle_object *rb = php_intl_resourcebundle_fetch_object(object);
@ -49,6 +49,8 @@ static void ResourceBundle_object_destroy( zend_object *object )
if (rb->child) {
ures_close( rb->child );
}
zend_object_std_dtor( &rb->zend );
}
/* }}} */
@ -449,7 +451,7 @@ void resourcebundle_register_class( void )
ResourceBundle_object_handlers = std_object_handlers;
ResourceBundle_object_handlers.offset = XtOffsetOf(ResourceBundle_object, zend);
ResourceBundle_object_handlers.clone_obj = NULL; /* ICU ResourceBundle has no clone implementation */
ResourceBundle_object_handlers.dtor_obj = ResourceBundle_object_destroy;
ResourceBundle_object_handlers.free_obj = ResourceBundle_object_free;
ResourceBundle_object_handlers.read_dimension = resourcebundle_array_get;
ResourceBundle_object_handlers.count_elements = resourcebundle_array_count;