aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPSSHTunnel.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2012-05-27 22:33:26 +0000
committerrowanbeentje <rowan@beent.je>2012-05-27 22:33:26 +0000
commit1f0dde0452519496a3d361ad6ddb38731c350a7e (patch)
tree94a37bd6d035ebf0c3e6956ba954fdf2466d24c6 /Source/SPSSHTunnel.m
parent03f6c875ed6c240e9af2916ce92584ac6624ef87 (diff)
downloadsequelpro-1f0dde0452519496a3d361ad6ddb38731c350a7e.tar.gz
sequelpro-1f0dde0452519496a3d361ad6ddb38731c350a7e.tar.bz2
sequelpro-1f0dde0452519496a3d361ad6ddb38731c350a7e.zip
Improve connection handling and editing:
- Fix long-standing intermittent crashes caused by connection errors after SSH tunnels were established - Fix edits causing keychain -25299 errors (Issue #1340) - Allow changes of favourite type to be saved rather than disassociating the edit from the selection - Fix the favourites view scrolling to the top when there's no selection and connection details are being edited - Fix some issues with automatic naming of connections on connection type change
Diffstat (limited to 'Source/SPSSHTunnel.m')
-rw-r--r--Source/SPSSHTunnel.m9
1 files changed, 7 insertions, 2 deletions
diff --git a/Source/SPSSHTunnel.m b/Source/SPSSHTunnel.m
index 106f8774..083a1000 100644
--- a/Source/SPSSHTunnel.m
+++ b/Source/SPSSHTunnel.m
@@ -390,11 +390,15 @@
{
if (connectionState == SPMySQLProxyIdle) return;
+ // If there's a delegate set, clear it to prevent unexpected state change messaging
+ if (delegate) {
+ delegate = nil;
+ stateChangeSelector = NULL;
+ }
+
// Before terminating the tunnel, check that it's actually running. This is to accommodate tunnels which
// suddenly disappear as a result of network disconnections.
if ([task isRunning]) [task terminate];
-
- if (delegate) [delegate performSelectorOnMainThread:stateChangeSelector withObject:self waitUntilDone:NO];
}
/*
@@ -663,6 +667,7 @@
delegate = nil;
[[NSNotificationCenter defaultCenter] removeObserver:self];
if (connectionState != SPMySQLProxyIdle) [self disconnect];
+ [NSObject cancelPreviousPerformRequestsWithTarget:self];
[sshHost release];
[sshLogin release];
[remoteHost release];