John Sundell: New in Swift 6.4 […] is a warning which is emitted when a nested closure performs a weak capture while the parent closure implicitly captures that object as a strong reference.At first glance, that new diagnostic could be a bit puzzling, since it might seem unnecessary to have to specify such a weak […]
New in Swift 6.4 […] is a warning which is emitted when a nested closure performs a
weakcapture while the parent closure implicitly captures that object as a strong reference.At first glance, that new diagnostic could be a bit puzzling, since it might seem unnecessary to have to specify such a weak capture twice (or, alternatively, move it to the parent closure’s capture list), but it turns out that it’s an incredibly useful new warning that can help us avoid a quite common kind of memory management bug.
[…]
Finally, in situations where capturing
selfstrongly doesn’t actually lead to a retain cycle, we can silence the new warning for nestedweakcaptures by explicitly addingselfto the outer closure’s capture list, such as when creating aTaskwithin the following example[…]
Previously:
Automatic Reference Counting (ARC) Language Design Memory Management Programming Swift Programming Language
1 Comment| # | Наименование новости | Тональность | Информативность | Дата публикации |
|---|---|---|---|---|
| 1 | Backporting SwiftUI APIs | 0 | 13.74 | 30-09-2026 |
| 2 | Aren’t Snapshots Purgeable? | 0 | 13.15 | 28-08-2026 |
| 3 | TipKit for the Real World | 0 | 13.84 | 01-09-2026 |
| 4 | ClipboardFusion 6.4 (Beta 8) Now Available! | 0 | 14.64 | 24-09-2026 |
| 5 | Toasty 0.6.0 - What is new? | 0 | 26.67 | 14-05-2026 |
| 6 | SwiftUI Toolbars | 0 | 9.7 | 08-09-2026 |
| 7 | Xcode 27 | 0 | 19.22 | 15-09-2026 |
| 8 | Xcode 27 Beta 6 Released | 0 | 21.4 | 28-08-2026 |
| 9 | CSCww60745 - FMC GUI packetcap fails when the nameif contains a dot | 0 | 7.17 | 07-10-2026 |
| 10 | The John Williams NewsClick: What do you think of new Apple watch feature that will listen to conversations and take notes? | 0 | 10 | 11-09-2026 |