aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2012-05-15 23:40:08 +0000
committerrowanbeentje <rowan@beent.je>2012-05-15 23:40:08 +0000
commitd2237c05664461e086664d25fbe717a06e9b5b75 (patch)
tree09a12ae538f4671f44866008bd493a47168f8b19 /Source
parent25238e46acd039cdaf410f31b2f064f2ea3db057 (diff)
downloadsequelpro-d2237c05664461e086664d25fbe717a06e9b5b75.tar.gz
sequelpro-d2237c05664461e086664d25fbe717a06e9b5b75.tar.bz2
sequelpro-d2237c05664461e086664d25fbe717a06e9b5b75.zip
Improve connection keepalive, disconnect, and connection loss after reviewing crash logs and testing a number of situations:
- Improve stability of closing connections after a connection loss - Minimise prompting a user for connection state restore if closing windows/tabs - Allow cancellation of keepalive ping threads to prevent crashes after deallocation of parent - Manually handle ping thread state struct memory to avoid cross-thread deallocation issues - Improve disconnection speed and resilience
Diffstat (limited to 'Source')
-rw-r--r--Source/SPDatabaseDocument.m8
-rw-r--r--Source/SPNavigatorController.m1
2 files changed, 5 insertions, 4 deletions
diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m
index 75af2ed1..f8f1585b 100644
--- a/Source/SPDatabaseDocument.m
+++ b/Source/SPDatabaseDocument.m
@@ -3961,12 +3961,14 @@ static NSString *SPRenameDatabaseAction = @"SPRenameDatabase";
// edits in progress in various views.
if ( ![tablesListInstance selectionShouldChangeInTableView:nil] ) return NO;
- // Auto-save spf file based connection and return whether the save was successful
+ // Auto-save spf file based connection and return if the save was not successful
if([self fileURL] && [[[self fileURL] path] length] && ![self isUntitled]) {
BOOL isSaved = [self saveDocumentWithFilePath:nil inBackground:YES onlyPreferences:YES contextInfo:nil];
- if(isSaved)
+ if (isSaved) {
[[SPQueryController sharedQueryController] removeRegisteredDocumentWithFileURL:[self fileURL]];
- return isSaved;
+ } else {
+ return NO;
+ }
}
// Terminate all running BASH commands
diff --git a/Source/SPNavigatorController.m b/Source/SPNavigatorController.m
index bd144e2a..9d1c660a 100644
--- a/Source/SPNavigatorController.m
+++ b/Source/SPNavigatorController.m
@@ -302,7 +302,6 @@ static NSComparisonResult compareStrings(NSString *s1, NSString *s2, void* conte
// If so, don't remove it.
if ([[NSApp delegate] frontDocument]) {
for(id doc in [[NSApp delegate] orderedDocuments]) {
- if(![[doc valueForKeyPath:@"mySQLConnection"] isConnected]) continue;
if([[doc connectionID] isEqualToString:connectionID])
docCounter++;
if(docCounter > 1) break;