> On Mar 4, 2017, at 1:09 AM, David Hart via swift-evolution 
> <[email protected]> wrote:
> 
> I encountered this precise memory leak in my code a few days ago, so I 
> sympathize. A second solution would be to drop function references. I think a 
> core team member suggested it on another thread.

If I had to guess, I’d surmise that it's probably the single most common memory 
leak in Swift and modern Objective-C code. What I wish is that it were possible 
to get rid of implicit captures altogether—instead of just inserting [weak 
self] when you *don’t* want to capture something strongly, also require [strong 
self] when you do. Referencing self otherwise causes an error. We’d never get 
away with it now, though, with the source compatibility promise in place.

Charles

_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to