I have just migrated a project to Swift 3 which worked surprisingly well for 
the number of changes necessary.

After checking out the new memory graph (cool!) I noticed that I am leaking 
notifications. Example:

        NSConcreteNotification 0x102c28600 {name = 
NSApplicationDidBecomeActiveNotification; object = <NSApplication: 0x100e15080>}

The really bad thing is, some were keeping old windows in memory!


After changing back to NSNotification where possible, all is well again.

Leaking:

        func windowDidBecomeKey(_ notification: Notification) {

Working:

        func windowDidBecomeKey(_ notification: NSNotification) {


Block based observers do still leak though.


This is what it looks like:

http://www.harmless.de/images/other/Notification-Leak.png

(Is there a way to get a textual representation of that graph?)

And here the backtrace:

http://www.harmless.de/images/other/Notification-Leak-Backtrace.png

Just below that is my window's init call.

(I couldn't figure out how to copy the backtrace either.)


_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to