X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-pq;a=blobdiff_plain;f=src%2Fphp_pq_object.c;fp=src%2Fphp_pq_object.c;h=5b3f217a95f7e7bb4c9561a7d954a34359787089;hp=c8d1e50bc73d4b1df3c119c48dabf396b4223e2e;hb=7074c710d3374eea1a81ed5ef5299f2d724c4497;hpb=9e81713ca24fd13c907c4e75b6da8e1f1e5d09f6 diff --git a/src/php_pq_object.c b/src/php_pq_object.c index c8d1e50..5b3f217 100644 --- a/src/php_pq_object.c +++ b/src/php_pq_object.c @@ -176,9 +176,11 @@ static inline HashTable *php_pq_object_get_gc_ex(zend_object *object, HashTable arg.ht = &arg.pq_obj->gc; arg.gc = 1; - zend_hash_clean(arg.ht); - zend_hash_copy(arg.ht, props, NULL); - zend_hash_apply_with_argument(&arg.pq_obj->zo.ce->properties_info, apply_pi_to_ht, &arg); + if (GC_REFCOUNT(arg.ht) == 1) { + zend_hash_clean(arg.ht); + zend_hash_copy(arg.ht, props, NULL); + zend_hash_apply_with_argument(&arg.pq_obj->zo.ce->properties_info, apply_pi_to_ht, &arg); + } *table = NULL; *n = 0;