From: Jay Freeman (saurik) Date: Fri, 13 Nov 2015 10:51:11 +0000 (-0800) Subject: JavaScriptCore assumes delete callback isn't NULL. X-Git-Tag: v0.9.505^0 X-Git-Url: https://git.saurik.com/cycript.git/commitdiff_plain/012c7408a0ace1ba4bdac9318bae201bc25b1f19?ds=inline JavaScriptCore assumes delete callback isn't NULL. --- 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