Skip to content

Commit 47d618c

Browse files
committed
Don't leak boxes when releasing Mirror owners
Heap boxes don't have a "class" metadata kind, so make sure to release them when creating a new owner for loading weak references in the runtime mirrors. rdar://problem/27348445
1 parent 3735c91 commit 47d618c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

stdlib/public/runtime/Reflection.mm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,8 @@ static bool loadSpecialReferenceStorage(HeapObject *owner,
428428
// owner now, we need to release the old owner to maintain the contract.
429429
if (owner->metadata->isAnyClass())
430430
swift_unknownRelease(owner);
431+
else
432+
swift_release(owner);
431433

432434
return true;
433435
}

0 commit comments

Comments
 (0)