From 66066bd85ec83dfbd86a06971a47c1eba3ee1bc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguye=CC=82=CC=83n?= Date: Mon, 30 Nov 2015 02:32:46 -0800 Subject: [PATCH] Quit on close --- macosx/AppDelegate.m | 8 +++++++- macosx/MainMenu.xib | 6 +++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/macosx/AppDelegate.m b/macosx/AppDelegate.m index 2bf9c8e71d3..3229176f7de 100644 --- a/macosx/AppDelegate.m +++ b/macosx/AppDelegate.m @@ -8,7 +8,7 @@ static NSString * const MGLMapboxAccessTokenDefaultsKey = @"MGLMapboxAccessToken"; -@interface AppDelegate () +@interface AppDelegate () @property (weak) IBOutlet NSWindow *window; @property (weak) IBOutlet MGLMapView *mapView; @@ -391,6 +391,12 @@ - (BOOL)validateToolbarItem:(NSToolbarItem *)toolbarItem { return NO; } +#pragma mark NSApplicationDelegate methods + +- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender { + return YES; +} + #pragma mark NSSharingServicePickerDelegate methods - (NS_ARRAY_OF(NSSharingService *) *)sharingServicePicker:(NSSharingServicePicker *)sharingServicePicker sharingServicesForItems:(NSArray *)items proposedSharingServices:(NS_ARRAY_OF(NSSharingService *) *)proposedServices { diff --git a/macosx/MainMenu.xib b/macosx/MainMenu.xib index 01e81ae6583..c96169b0947 100644 --- a/macosx/MainMenu.xib +++ b/macosx/MainMenu.xib @@ -10,7 +10,11 @@ - + + + + +