From dfbf18cc67989e2688b677069a4538c0ff7f9cd0 Mon Sep 17 00:00:00 2001 From: theraven Date: Sat, 16 Jul 2011 17:00:23 +0000 Subject: [PATCH] Fixed <= bug in weak references. We're storing the EXTRA retain count, not the refcount. --- arc.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arc.m b/arc.m index f40ed0f..35bcd18 100644 --- a/arc.m +++ b/arc.m @@ -453,7 +453,7 @@ id objc_storeWeak(id *addr, id obj) } else if (objc_test_class_flag(obj->isa, objc_class_flag_fast_arc)) { - if ((*(((intptr_t*)obj) - 1)) <= 0) + if ((*(((intptr_t*)obj) - 1)) < 0) { return nil; } @@ -541,7 +541,7 @@ id objc_loadWeakRetained(id* addr) } else if (objc_test_class_flag(obj->isa, objc_class_flag_fast_arc)) { - if ((*(((intptr_t*)obj) - 1)) <= 0) + if ((*(((intptr_t*)obj) - 1)) < 0) { return nil; }