]> git.saurik.com Git - cycript.git/commitdiff
JavaScriptCore assumes delete callback isn't NULL. v0.9.505
authorJay Freeman (saurik) <saurik@saurik.com>
Fri, 13 Nov 2015 10:51:11 +0000 (02:51 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Fri, 13 Nov 2015 10:51:11 +0000 (02:51 -0800)
Execute.cpp

index 04a86a3c66b844fe31e292f0a18a1e6920d33b50..8c50dcd3b0bc5354c9820c51054436d09fe75652 100644 (file)
@@ -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<uintptr_t>(weak)));
     }
 #endif