From: Jay Freeman (saurik) Date: Fri, 23 Oct 2009 23:25:35 +0000 (+0000) Subject: Fixed a crash that was occuring when unowned objects were deallocated. X-Git-Tag: v0.9.432~262 X-Git-Url: https://git.saurik.com/cycript.git/commitdiff_plain/d4e145d9b21e29d7056362b38be349570753f76f Fixed a crash that was occuring when unowned objects were deallocated. --- diff --git a/Library.mm b/Library.mm index 3759751..a9a0ae4 100644 --- a/Library.mm +++ b/Library.mm @@ -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 { diff --git a/todo.txt b/todo.txt index 0b1db01..435dce4 100644 --- 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]; }