summaryrefslogtreecommitdiff
path: root/zend/value.cpp
diff options
context:
space:
mode:
authorToon Schoenmakers <toon.schoenmakers@copernica.com>2014-11-21 14:23:58 +0100
committerToon Schoenmakers <toon.schoenmakers@copernica.com>2014-11-21 14:23:58 +0100
commit578fc01d0e6ba0be7818ad2d2533aa3a2dde3ba4 (patch)
tree80871f41b76a38d82f6d8298fcc4ab261a3b0173 /zend/value.cpp
parent2e25bc7e1b9faf89e6057ed7874ef2f4a8c86ca1 (diff)
fixed value destructor, reference variables should not be unreferenced
Diffstat (limited to 'zend/value.cpp')
-rw-r--r--zend/value.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/zend/value.cpp b/zend/value.cpp
index 544926a..b28096a 100644
--- a/zend/value.cpp
+++ b/zend/value.cpp
@@ -303,7 +303,13 @@ Value::~Value()
// if there were two references or less, we're going to remove a reference
// and only one reference will remain, the object will then impossible be
// a reference
- if (Z_REFCOUNT_P(_val) <= 2) Z_UNSET_ISREF_P(_val);
+ //
+ // This initially seemed to be a good idea, because reference-variables
+ // are hard to deal with, and a reference with only one or even zero variables
+ // pointing towards it seem silly, but this line of code caused objects only
+ // to be destructed when the script exits
+ //
+ // if (Z_REFCOUNT_P(_val) <= 2) Z_UNSET_ISREF_P(_val);
// destruct the zval (this function will decrement the reference counter,
// and only destruct if there are no other references left)