aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPConnectionController.m
diff options
context:
space:
mode:
Diffstat (limited to 'Source/SPConnectionController.m')
-rw-r--r--Source/SPConnectionController.m6
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/SPConnectionController.m b/Source/SPConnectionController.m
index 18899cc5..52cb75bc 100644
--- a/Source/SPConnectionController.m
+++ b/Source/SPConnectionController.m
@@ -1815,21 +1815,23 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2,
[(NSView *)favoritesOutlineView display];
}
-#pragma mark -
-
- (void)_documentWillClose:(NSNotification *)notification
{
cancellingConnection = YES;
dbDocument = nil;
+
if (mySQLConnection) {
[mySQLConnection setDelegate:nil];
[NSThread detachNewThreadWithName:@"SPConnectionController close background disconnect" target:mySQLConnection selector:@selector(disconnect) object:nil];
[mySQLConnection autorelease];
mySQLConnection = nil;
}
+
if (sshTunnel) [sshTunnel setConnectionStateChangeSelector:nil delegate:nil], [sshTunnel disconnect], [sshTunnel release];
}
+#pragma mark -
+
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];