Skip to content

Commit 8dcf757

Browse files
authored
Merge pull request #65972 from apple/better-deinit-escape-wording
[Runtime] Improve wording of deinit escape warning.
2 parents e342ac4 + dc3416b commit 8dcf757

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

stdlib/public/runtime/HeapObject.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -819,8 +819,11 @@ void swift::swift_deallocClassInstance(HeapObject *object,
819819
auto descriptor = object->metadata->getTypeContextDescriptor();
820820

821821
swift::fatalError(0,
822-
"Object %p of class %s deallocated with retain count %zd, "
823-
"reference may have escaped from deinit.\n",
822+
"Object %p of class %s deallocated with non-zero retain "
823+
"count %zd. This object's deinit, or something called "
824+
"from it, may have created a strong reference to self "
825+
"which outlived deinit, resulting in a dangling "
826+
"reference.\n",
824827
object,
825828
descriptor ? descriptor->Name.get() : "<unknown>",
826829
retainCount);

0 commit comments

Comments
 (0)