While profiling with Instruments, I noticed an NSTrackingArea
leaking every time I created a window. The change below, applied to NSViewComponentPeer
's constructor, addressed the issue for me:
| NSTrackingEnabledDuringMouseDrag
| NSTrackingActiveAlways
| NSTrackingInVisibleRect;
- [view addTrackingArea: [[NSTrackingArea alloc] initWithRect: r
- options: options
- owner: view
- userInfo: nil]];
+
+ NSTrackingArea* trackingArea = [[NSTrackingArea alloc] initWithRect: r
+ options: options
+ owner: view
+ userInfo: nil];
+
+ [view addTrackingArea: trackingArea];
+ [trackingArea release];
notificationCenter = [NSNotificationCenter defaultCenter];