aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPWindowController.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-08-19 20:28:39 +0000
committerBibiko <bibiko@eva.mpg.de>2010-08-19 20:28:39 +0000
commitfdf2f07d8dfd4260c2dd5dd3326ad7206c1e30f1 (patch)
treef3029d320bf887a3bf360cb7ae8163f447fb26e8 /Source/SPWindowController.m
parent692e6e7330d9a6fd0227f74c1665ddc0b19cc4c6 (diff)
downloadsequelpro-fdf2f07d8dfd4260c2dd5dd3326ad7206c1e30f1.tar.gz
sequelpro-fdf2f07d8dfd4260c2dd5dd3326ad7206c1e30f1.tar.bz2
sequelpro-fdf2f07d8dfd4260c2dd5dd3326ad7206c1e30f1.zip
• made usage of SPBeginWaitingAlertSheet while closing a spf file for readability of that spf file
• suppress if a window with one tab will be closed that [... parentTabShouldClose] method will be called twice via closeTab: - this issue could be the reason for recent crashes/exception esp. of the NSNavigator (should be investigated further)
Diffstat (limited to 'Source/SPWindowController.m')
-rw-r--r--Source/SPWindowController.m12
1 files changed, 8 insertions, 4 deletions
diff --git a/Source/SPWindowController.m b/Source/SPWindowController.m
index 65c1c330..33a5ae74 100644
--- a/Source/SPWindowController.m
+++ b/Source/SPWindowController.m
@@ -596,10 +596,14 @@
*/
- (BOOL)windowShouldClose:(id)sender
{
- for (NSTabViewItem *eachItem in [tabView tabViewItems]) {
- SPDatabaseDocument *eachDocument = [eachItem identifier];
- if (![eachDocument parentTabShouldClose]) return NO;
- }
+
+ // Iterate through all tabs if more than one tab is opened only otherwise
+ // [... parentTabShouldClose] will be called twice [see self closeTab:(id)sender]
+ if([[tabView tabViewItems] count] > 1)
+ for (NSTabViewItem *eachItem in [tabView tabViewItems]) {
+ SPDatabaseDocument *eachDocument = [eachItem identifier];
+ if (![eachDocument parentTabShouldClose]) return NO;
+ }
// Remove global session data if the last window of a session will be closed
if([[NSApp delegate] sessionURL] && [[[NSApp delegate] orderedDatabaseConnectionWindows] count] == 1) {