浏览代码

Use the Z_ADDREF_P macro to increasing the refcount of PHP values assigned to V8.

Simon Best 12 年之前
父节点
当前提交
a20c4b84cc
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      v8js_convert.cc

+ 2 - 1
v8js_convert.cc

@@ -385,8 +385,9 @@ static v8::Handle<v8::Value> php_v8js_hash_to_jsobj(zval *value TSRMLS_DC) /* {{
 			}
 		}
 
+		// Increase the reference count of this value because we're storing it internally for use later
 		// See https://github.com/preillyme/v8js/issues/6
-		Z_SET_REFCOUNT_P(value, Z_REFCOUNT_P(value) + 1);
+		Z_ADDREF_P(value);
 
 		newobj->SetAlignedPointerInInternalField(0, (void *) value);
 	} else {