diff --git a/atom/browser/ui/tray_icon_cocoa.mm b/atom/browser/ui/tray_icon_cocoa.mm index a6b5bb96b03d..629180478e16 100644 --- a/atom/browser/ui/tray_icon_cocoa.mm +++ b/atom/browser/ui/tray_icon_cocoa.mm @@ -58,11 +58,11 @@ const CGFloat kVerticalTitleMargin = 2; [self updateDimensions]; // Add NSTrackingArea for listening to mouseEnter and mouseExit events - NSTrackingArea* trackingArea = [[NSTrackingArea alloc] + auto trackingArea = [[[NSTrackingArea alloc] initWithRect:[self bounds] options:NSTrackingMouseEnteredAndExited | NSTrackingActiveAlways owner:self - userInfo:nil]; + userInfo:nil] autorelease]; [self addTrackingArea:trackingArea]; } return self;