소스 검색

Always increase the zval reference count before storing it in a V8 internal field

Patrick Reilly 12 년 전
부모
커밋
de2d78a144
1개의 변경된 파일1개의 추가작업 그리고 4개의 파일을 삭제
  1. 1 4
      v8js_convert.cc

+ 1 - 4
v8js_convert.cc

@@ -386,10 +386,7 @@ static v8::Handle<v8::Value> php_v8js_hash_to_jsobj(zval *value TSRMLS_DC) /* {{
 		}
 		
 			// See https://github.com/preillyme/v8js/issues/6
-			if (Z_REFCOUNT_P(value) == 1)
-			{
-			      Z_SET_REFCOUNT_P(value, 2);
-			}
+			Z_SET_REFCOUNT_P(value, Z_REFCOUNT_P(value) + 1);
 			
 		newobj->SetAlignedPointerInInternalField(0, (void *) value);
 	} else {