Fixed <= bug in weak references. We're storing the EXTRA retain count, not the refcount.

main
theraven 15 years ago
parent 61a7c53a08
commit dfbf18cc67

@ -453,7 +453,7 @@ id objc_storeWeak(id *addr, id obj)
} }
else if (objc_test_class_flag(obj->isa, objc_class_flag_fast_arc)) 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; return nil;
} }
@ -541,7 +541,7 @@ id objc_loadWeakRetained(id* addr)
} }
else if (objc_test_class_flag(obj->isa, objc_class_flag_fast_arc)) 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; return nil;
} }

Loading…
Cancel
Save