From 1b8a296b5d1fdd7f6d7daa099f7feef869e05e5e Mon Sep 17 00:00:00 2001 From: Jochen Eisinger Date: Thu, 14 May 2015 02:00:44 +0200 Subject: Use phantom handles instead of weak handles Phantom handles allow for freeing objects with one pass of GC. However, this means that by the time the callback is invoked, the v8 object already does no longer exist. To avoid accidential access to the dead object, there are now two callbacks, where the first must only reset the handle, and the second does the clean-up work. R=tsepez@chromium.org BUG= Review URL: https://codereview.chromium.org/1129253004 --- fpdfsdk/include/jsapi/fxjs_v8.h | 1 + 1 file changed, 1 insertion(+) (limited to 'fpdfsdk/include/jsapi') diff --git a/fpdfsdk/include/jsapi/fxjs_v8.h b/fpdfsdk/include/jsapi/fxjs_v8.h index a32ace674b..7f23380406 100644 --- a/fpdfsdk/include/jsapi/fxjs_v8.h +++ b/fpdfsdk/include/jsapi/fxjs_v8.h @@ -82,6 +82,7 @@ void JS_SetPrivate(IJS_Runtime* pJSRuntime, v8::Handle pObj, v void* JS_GetPrivate(IJS_Runtime* pJSRuntime, v8::Handle pObj); void JS_SetPrivate(v8::Handle pObj, void* p); void* JS_GetPrivate(v8::Handle pObj); +void JS_FreePrivate(void* p); void JS_FreePrivate(v8::Handle pObj); v8::Handle JS_GetObjectValue(v8::Handle pObj); v8::Handle JS_GetObjectElement(IJS_Runtime* pJSRuntime, v8::Handle pObj,const wchar_t* PropertyName); -- cgit v1.2.3