summaryrefslogtreecommitdiff
path: root/Zend/zend_variables.c
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/zend_variables.c')
-rw-r--r--Zend/zend_variables.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/Zend/zend_variables.c b/Zend/zend_variables.c
index da3fedb505..6d5452c94e 100644
--- a/Zend/zend_variables.c
+++ b/Zend/zend_variables.c
@@ -89,14 +89,22 @@ ZEND_API int _zval_dtor(zval *zvalue ZEND_FILE_LINE_DC)
}
+void zval_del_ref(zval **p)
+{
+ (*p)->refcount--;
+ if ((*p)->refcount==0) {
+ zval_dtor(*p);
+ efree(*p);
+ }
+}
+
+
void zval_add_ref(zval **p)
{
(*p)->refcount++;
}
-
-
ZEND_API int _zval_copy_ctor(zval *zvalue ZEND_FILE_LINE_DC)
{
switch (zvalue->type) {