- improve static property handling
[m6w6/ext-http] / missing.c
index 3390c75d0de18a55c495bf7eab49de6226778a4c..81d5183f4d376b2abbf182c5062f06d5ff2495a1 100644 (file)
--- a/missing.c
+++ b/missing.c
@@ -130,6 +130,7 @@ int zend_update_static_property(zend_class_entry *scope, char *name, size_t name
        } else if (*property == value) {
                retval = SUCCESS;
        } else {
+               value->refcount++;
                if (PZVAL_IS_REF(*property)) {
                        zval_dtor(*property);
                        (*property)->type = value->type;
@@ -145,11 +146,6 @@ int zend_update_static_property(zend_class_entry *scope, char *name, size_t name
                retval = SUCCESS;
        }
        
-       if (!value->refcount) {
-               zval_dtor(value);
-               FREE_ZVAL(value);
-       }
-       
        EG(scope) = old_scope;
        
        return retval;