diff --git a/arc.mm b/arc.mm index ee3efbfe..fbba14c0 100644 --- a/arc.mm +++ b/arc.mm @@ -838,8 +838,9 @@ static BOOL setObjectHasWeakRefs(id obj) WeakRef *oldRef; id old; loadWeakPointer(addr, &old, &oldRef); - // If the old and new values are the same, then we don't need to do anything. - if (old == obj) + // If the old and new values are the same, then we don't need to do anything + // unless we are deleting the weak reference by storing NULL to it. + if ((old == obj) && ((obj != NULL) || (NULL == oldRef))) { return obj; }