Open swift-ci opened 7 years ago
Full test case in the dup.
Comment by Kostiantyn Herasimov (JIRA)
This also hides errors when captured instance (like a UIViewController) is deallocating inside wrong thread (like not main). It could be hard to find that cases because where is no any warning from compiler
Additional Detail from JIRA
| | | |------------------|-----------------| |Votes | 4 | |Component/s | Compiler | |Labels | Improvement, LanguageFeatureRequest | |Assignee | None | |Priority | Medium | md5: 749bbb1e7e9a82cb5f26ca678d24746eis duplicated by:
Issue Description:
This was discussed on the mailing list over a year ago but no proposal was made:
https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20151207/001197.html
This leaks memory in a subtle way...there is a retain loop even though self is only used in a "weak" manner. This is because the nested closure captures a strong reference for use in the closure that follows.