aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPDatabaseDocument.m
diff options
context:
space:
mode:
Diffstat (limited to 'Source/SPDatabaseDocument.m')
-rw-r--r--Source/SPDatabaseDocument.m6
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m
index fa46db2d..7f2abab6 100644
--- a/Source/SPDatabaseDocument.m
+++ b/Source/SPDatabaseDocument.m
@@ -415,6 +415,10 @@ static NSString *SPRenameDatabaseAction = @"SPRenameDatabase";
- (void)setConnection:(SPMySQLConnection *)theConnection
{
+ if ([theConnection userTriggeredDisconnect]) {
+ return;
+ }
+
_isConnected = YES;
mySQLConnection = [theConnection retain];
@@ -5762,7 +5766,7 @@ static NSString *SPRenameDatabaseAction = @"SPRenameDatabase";
if (processListController) [processListController release];
if (serverVariablesController) [serverVariablesController release];
#endif
- if (mySQLConnection) [mySQLConnection release];
+ if (mySQLConnection) [mySQLConnection release], mySQLConnection = nil;
if (selectedDatabase) [selectedDatabase release];
if (mySQLVersion) [mySQLVersion release];
#ifndef SP_REFACTOR