]> git.saurik.com Git - cycript.git/blobdiff - ObjectiveC/Library.mm
Fixed the GC crash of doom that kennytm reported: apparently local contexts come...
[cycript.git] / ObjectiveC / Library.mm
index c3f073a80206005a134740ae0cd48976d1a46181..a3c1d66b9b784af87a6995630a59e016a231669c 100644 (file)
@@ -1053,13 +1053,15 @@ JSValueRef CYCastJSValue(JSContextRef context, NSObject *value) { CYPoolTry {
 - (id) initWithJSObject:(JSObjectRef)object inContext:(JSContextRef)context { CYObjectiveTry {
     if ((self = [super init]) != nil) {
         object_ = object;
-        context_ = context;
+        context_ = CYGetJSContext(context);
+        //XXX:JSGlobalContextRetain(context_);
         JSValueProtect(context_, object_);
     } return self;
 } CYObjectiveCatch }
 
 - (void) dealloc { CYObjectiveTry {
     JSValueUnprotect(context_, object_);
+    //XXX:JSGlobalContextRelease(context_);
     [super dealloc];
 } CYObjectiveCatch }
 
@@ -1127,13 +1129,15 @@ JSValueRef CYCastJSValue(JSContextRef context, NSObject *value) { CYPoolTry {
 - (id) initWithJSObject:(JSObjectRef)object inContext:(JSContextRef)context { CYObjectiveTry {
     if ((self = [super init]) != nil) {
         object_ = object;
-        context_ = context;
+        context_ = CYGetJSContext(context);
+        //XXX:JSGlobalContextRetain(context_);
         JSValueProtect(context_, object_);
     } return self;
 } CYObjectiveCatch }
 
 - (void) dealloc { CYObjectiveTry {
     JSValueUnprotect(context_, object_);
+    //XXX:JSGlobalContextRelease(context_);
     [super dealloc];
 } CYObjectiveCatch }