]> git.saurik.com Git - cycript.git/commitdiff
Fixed a crash that was occuring when unowned objects were deallocated.
authorJay Freeman (saurik) <saurik@saurik.com>
Fri, 23 Oct 2009 23:25:35 +0000 (23:25 +0000)
committerJay Freeman (saurik) <saurik@saurik.com>
Fri, 23 Oct 2009 23:25:35 +0000 (23:25 +0000)
Library.mm
todo.txt

index 3759751e793c257c0233c8b7279791da6bd712d7..a9a0ae4d29c3137e8b36765bf18c13feda595f95 100644 (file)
@@ -533,11 +533,13 @@ struct CYOwned :
         context_(context),
         owner_(owner)
     {
-        JSValueProtect(context_, owner_);
+        if (owner_ != NULL)
+            JSValueProtect(context_, owner_);
     }
 
     virtual ~CYOwned() {
-        JSValueUnprotect(context_, owner_);
+        if (owner_ != NULL)
+            JSValueUnprotect(context_, owner_);
     }
 
     JSObjectRef GetOwner() const {
index 0b1db01e331f45b1551c3d91a0c2025d7ad931c7..435dce40616b4b1e2f4cb628dceeba51d9ea843e 100644 (file)
--- a/todo.txt
+++ b/todo.txt
@@ -1,8 +1,5 @@
-labelled statements don't get labelled
-blocks and empty statements are poorly factored
 unicode identifier support (native and \u)
 object literal compilation should use numerify strings
 support unions (right now 0-1 fields parsed as struct)
 \\\n escapes in strings aren't handled in the console
 look into what String is, and whether to bridge it
-for each (k in ObjectiveC.classes) { if (class_getInstanceMethod(k, @selector(description))) [k description]; }