summaryrefslogtreecommitdiff
path: root/ext/sqlite/sqlite.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/sqlite/sqlite.c')
-rw-r--r--ext/sqlite/sqlite.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/ext/sqlite/sqlite.c b/ext/sqlite/sqlite.c
index 13633b8f8c..fb97233695 100644
--- a/ext/sqlite/sqlite.c
+++ b/ext/sqlite/sqlite.c
@@ -802,8 +802,7 @@ static void sqlite_object_free_storage(void *object TSRMLS_DC)
{
sqlite_object *intern = (sqlite_object *)object;
- zend_hash_destroy(intern->std.properties);
- FREE_HASHTABLE(intern->std.properties);
+ zend_object_std_dtor(&intern->std TSRMLS_CC);
if (intern->u.ptr) {
if (intern->type == is_db) {
@@ -826,10 +825,8 @@ static void sqlite_object_new(zend_class_entry *class_type, zend_object_handlers
intern = emalloc(sizeof(sqlite_object));
memset(intern, 0, sizeof(sqlite_object));
- intern->std.ce = class_type;
- ALLOC_HASHTABLE(intern->std.properties);
- zend_hash_init(intern->std.properties, 0, NULL, ZVAL_PTR_DTOR, 0);
+ zend_object_std_init(&intern->std, class_type TSRMLS_CC);
zend_hash_copy(intern->std.properties, &class_type->default_properties, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
retval->handle = zend_objects_store_put(intern, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t) sqlite_object_free_storage, NULL TSRMLS_CC);