Memory leak on macOS in NSViewComponentPeer

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];
1 Like

Thanks for reporting. The issue is fixed here: