diff options
author | Bibiko <bibiko@eva.mpg.de> | 2010-11-30 00:16:06 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2010-11-30 00:16:06 +0000 |
commit | cc2e00c656a34d4c472a25f929282c8fc63d0174 (patch) | |
tree | 34d4f213f4efc4ddd73625e5941d002b6e3bd92f /Source/SPDatabaseDocument.m | |
parent | c1cb48f6afa93b8ed26baa434d66d1ca3e0afca7 (diff) | |
download | sequelpro-cc2e00c656a34d4c472a25f929282c8fc63d0174.tar.gz sequelpro-cc2e00c656a34d4c472a25f929282c8fc63d0174.tar.bz2 sequelpro-cc2e00c656a34d4c472a25f929282c8fc63d0174.zip |
• Bundle commands
- before closing a db doc window kill all commands associated to this doc
- suppress an error message if a bash command was killed via code 9
- added a temporary and preliminary table view to display command activities (double-click at TABLE INFO header to toggle and refresh it - only for testing purposes - it shows all commands started from that db doc and a General command names)
Diffstat (limited to 'Source/SPDatabaseDocument.m')
-rw-r--r-- | Source/SPDatabaseDocument.m | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index 23805b12..8ec6ad61 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -3655,6 +3655,7 @@ */ - (BOOL)parentTabShouldClose { + // If no connection is available, always return YES. Covers initial setup and disconnections. if(!_isConnected) return YES; @@ -3673,8 +3674,23 @@ return isSaved; } + // Terminate all running BASH commands + for(NSDictionary* cmd in [self runningBASHProcesses]) { + NSInteger pid = [[cmd objectForKey:@"pid"] intValue]; + NSTask *killTask = [[NSTask alloc] init]; + [killTask setLaunchPath:@"/bin/sh"]; + [killTask setArguments:[NSArray arrayWithObjects:@"-c", [NSString stringWithFormat:@"kill -9 -%ld", pid], nil]]; + [killTask launch]; + [killTask waitUntilExit]; + [killTask release]; + } + [[SPNavigatorController sharedNavigatorController] performSelectorOnMainThread:@selector(removeConnection:) withObject:[self connectionID] waitUntilDone:YES]; + // Note that this call does not need to be removed in release builds as leaks analysis output is only + // dumped if [[SPLogger logger] setDumpLeaksOnTermination]; has been called first. + [[SPLogger logger] dumpLeaks]; + // Return YES by default return YES; } @@ -3703,6 +3719,7 @@ [createTableSyntaxWindow orderOut:nil]; [[NSNotificationCenter defaultCenter] removeObserver:self]; [self setParentWindow:nil]; + } /** |