aboutsummaryrefslogtreecommitdiffstats
path: root/Source/CMMCPConnection.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2009-07-15 00:23:13 +0000
committerrowanbeentje <rowan@beent.je>2009-07-15 00:23:13 +0000
commitaa2f8b4cbddb68b4aadd6544eb754c8468746633 (patch)
treecc4ca55dff6bcdda5480d7bb4d2fcdc16cb58517 /Source/CMMCPConnection.m
parent0612652448f32e620a96e923a44b463fa1b9e0dc (diff)
downloadsequelpro-aa2f8b4cbddb68b4aadd6544eb754c8468746633.tar.gz
sequelpro-aa2f8b4cbddb68b4aadd6544eb754c8468746633.tar.bz2
sequelpro-aa2f8b4cbddb68b4aadd6544eb754c8468746633.zip
- Make the DBView window the document window. This allows the document to be closed when the window is closed, freeing the document's memory
- Update a number of dealloc methods to include more retained memory, and to avoid releasing non-retained memory - Remove notification observers and delegates where appropriate to avoid issues after document closing - Fix a couple of memory leaks - Support window cascading for all windows past the first, using the first window as the autosave window
Diffstat (limited to 'Source/CMMCPConnection.m')
-rw-r--r--Source/CMMCPConnection.m12
1 files changed, 7 insertions, 5 deletions
diff --git a/Source/CMMCPConnection.m b/Source/CMMCPConnection.m
index 0e3e085a..9848101e 100644
--- a/Source/CMMCPConnection.m
+++ b/Source/CMMCPConnection.m
@@ -320,7 +320,7 @@ static void forcePingTimeout(int signalNumber);
if (connectionTunnel) {
[connectionTunnel disconnect];
- [delegate setTitlebarStatus:@"SSH Disconnected"];
+ if (delegate) [delegate setTitlebarStatus:@"SSH Disconnected"];
//[delegate setStatusIconToImageWithName:@"ssh-disconnected"];
}
@@ -421,7 +421,7 @@ static void forcePingTimeout(int signalNumber);
if ([connectionTunnel state] != SPSSH_STATE_IDLE) [connectionTunnel disconnect];
[connectionTunnel connect];
- [delegate setTitlebarStatus:@"SSH Connecting…"];
+ if (delegate) [delegate setTitlebarStatus:@"SSH Connecting…"];
//[delegate setStatusIconToImageWithName:@"ssh-connecting"];
NSDate *tunnelStartDate = [NSDate date], *interfaceInteractionTimer;
@@ -429,14 +429,14 @@ static void forcePingTimeout(int signalNumber);
// Allow the tunnel to attempt to connect in a loop
while (1) {
if ([connectionTunnel state] == SPSSH_STATE_CONNECTED) {
- [delegate setTitlebarStatus:@"SSH Connected"];
+ if (delegate) [delegate setTitlebarStatus:@"SSH Connected"];
//[delegate setStatusIconToImageWithName:@"ssh-connected"];
connectionPort = [connectionTunnel localPort];
break;
}
if ([[NSDate date] timeIntervalSinceDate:tunnelStartDate] > (connectionTimeout + 1)) {
[connectionTunnel disconnect];
- [delegate setTitlebarStatus:@"SSH Disconnected"];
+ if (delegate) [delegate setTitlebarStatus:@"SSH Disconnected"];
//[delegate setStatusIconToImageWithName:@"ssh-disconnected"];
break;
}
@@ -704,7 +704,7 @@ static void forcePingTimeout(int signalNumber);
lastQueryErrorId = mysql_errno(mConnection);
if (connectionTunnel) {
[connectionTunnel disconnect];
- [delegate setTitlebarStatus:@"SSH Disconnected"];
+ if (delegate) [delegate setTitlebarStatus:@"SSH Disconnected"];
//[delegate setStatusIconToImageWithName:@"ssh-disconnected"];
}
return NO;
@@ -1347,6 +1347,8 @@ static void forcePingTimeout(int signalNumber)
- (void) dealloc
{
+ delegate = nil;
+ [[NSNotificationCenter defaultCenter] removeObserver:self];
if (lastQueryErrorMessage) [lastQueryErrorMessage release];
if (connectionHost) [connectionHost release];
if (connectionLogin) [connectionLogin release];