From d4e145d9b21e29d7056362b38be349570753f76f Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Fri, 23 Oct 2009 23:25:35 +0000 Subject: [PATCH] Fixed a crash that was occuring when unowned objects were deallocated. --- Library.mm | 6 ++++-- todo.txt | 3 --- 2 files changed, 4 insertions(+), 5 deletions(-) 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]; } -- 2.45.2