mirror of
https://github.com/phpv8/v8js.git
synced 2025-01-03 10:21:51 +00:00
Simplify php_v8js_weak_object_callback.
This also fixes a leak in the `object_dom` testcase, where the DOM extension returns an object with refcnt 1 but object_store refcnt 2, causing READY_TO_DESTROY to return false. Don't try to be fancy, just use the standard PHP destructor.
This commit is contained in:
parent
a730ddeb67
commit
892c654c8c
@ -260,12 +260,7 @@ static void php_v8js_weak_object_callback(const v8::WeakCallbackData<v8::Object,
|
|||||||
v8::Isolate *isolate = data.GetIsolate();
|
v8::Isolate *isolate = data.GetIsolate();
|
||||||
zval *value = data.GetParameter();
|
zval *value = data.GetParameter();
|
||||||
V8JS_TSRMLS_FETCH();
|
V8JS_TSRMLS_FETCH();
|
||||||
if (READY_TO_DESTROY(value)) {
|
zval_ptr_dtor(&value);
|
||||||
zval_dtor(value);
|
|
||||||
FREE_ZVAL(value);
|
|
||||||
} else {
|
|
||||||
Z_DELREF_P(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
v8::V8::AdjustAmountOfExternalAllocatedMemory(-1024);
|
v8::V8::AdjustAmountOfExternalAllocatedMemory(-1024);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user