From 8fcdb7bcc6dedb7af9b1a7829a83cdc2fca54f4b Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 16 May 2017 00:29:21 +0200 Subject: Fix an erroneous check that would allow to close windows with only one tab even when it was busy (#2787) --- Source/SPWindowController.m | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'Source/SPWindowController.m') diff --git a/Source/SPWindowController.m b/Source/SPWindowController.m index 7f3c687b..9755cd0d 100644 --- a/Source/SPWindowController.m +++ b/Source/SPWindowController.m @@ -160,15 +160,14 @@ */ - (IBAction)closeTab:(id)sender { - // Return if the selected tab shouldn't be closed - if (![selectedTableDocument parentTabShouldClose]) return; - // If there are multiple tabs, close the front tab. if ([tabView numberOfTabViewItems] > 1) { + // Return if the selected tab shouldn't be closed + if (![selectedTableDocument parentTabShouldClose]) return; [tabView removeTabViewItem:[tabView selectedTabViewItem]]; - } else { + //trying to close the window will itself call parentTabShouldClose for all tabs in windowShouldClose: [[self window] performClose:self]; } } -- cgit v1.2.3