From 012c7408a0ace1ba4bdac9318bae201bc25b1f19 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Fri, 13 Nov 2015 02:51:11 -0800 Subject: [PATCH] JavaScriptCore assumes delete callback isn't NULL. --- Execute.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Execute.cpp b/Execute.cpp index 04a86a3..8c50dcd 100644 --- a/Execute.cpp +++ b/Execute.cpp @@ -1833,6 +1833,9 @@ static JSValueRef require(JSContextRef context, JSObjectRef object, JSObjectRef return CYGetProperty(context, module, property); } CYCatch(NULL) } +extern "C" void CYDestroyWeak(JSWeakObjectMapRef weak, void *data) { +} + extern "C" void CYSetupContext(JSGlobalContextRef context) { CYInitializeDynamic(); @@ -1934,7 +1937,7 @@ extern "C" void CYSetupContext(JSGlobalContextRef context) { #ifdef __APPLE__ if (&JSWeakObjectMapCreate != NULL) { - JSWeakObjectMapRef weak(JSWeakObjectMapCreate(context, NULL, NULL)); + JSWeakObjectMapRef weak(JSWeakObjectMapCreate(context, NULL, &CYDestroyWeak)); CYSetProperty(context, cy, weak_s, CYCastJSValue(context, reinterpret_cast(weak))); } #endif -- 2.47.2