diff options
author | Martijn Otto <martijn.otto@copernica.com> | 2016-05-18 12:52:50 +0200 |
---|---|---|
committer | Martijn Otto <martijn.otto@copernica.com> | 2016-05-18 12:52:50 +0200 |
commit | d99626582c2a217abead069237958be10c701d41 (patch) | |
tree | 5889e9a9266a5f4bc785c4275401f031a781c028 | |
parent | cd047b9bb786166485ec21d83d047428f561e6eb (diff) |
Fix failing assert for Value::clone in cases where the type is not refcounted
-rw-r--r-- | zend/value.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/zend/value.cpp b/zend/value.cpp index 547ff85..df756c5 100644 --- a/zend/value.cpp +++ b/zend/value.cpp @@ -1146,11 +1146,12 @@ Value Value::clone() const // copy the data ZVAL_DUP(copy, _val); - // wrap it using the Value(zval*) constructor, this will +1 the refcount!!!! + // wrap it using the Value(zval*) constructor, + // this will +1 the refcount for counted values Value output(copy); // -1 the refcount to avoid future leaks - Z_DELREF_P(copy); + Z_TRY_DELREF_P(copy); // done return output; |