diff --git a/arc.m b/arc.m index 719ed9d..321e532 100644 --- a/arc.m +++ b/arc.m @@ -856,8 +856,9 @@ OBJC_PUBLIC id objc_loadWeakRetained(id* addr) if (obj == nil) { // If we've destroyed this weak ref, then make sure that we also deallocate the object. - if (weakRefRelease(ref)) + if (ref != NULL) { + weakRefRelease(ref); *addr = nil; } return nil;