aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/SPDatabaseDocument.m16
-rw-r--r--Source/SPDatabaseViewController.m4
2 files changed, 12 insertions, 8 deletions
diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m
index 96bfbf39..adff490d 100644
--- a/Source/SPDatabaseDocument.m
+++ b/Source/SPDatabaseDocument.m
@@ -835,12 +835,12 @@
if (selectedDatabase) [selectedDatabase release], selectedDatabase = nil;
selectedDatabase = [[NSString alloc] initWithString:dbName];
[chooseDatabaseButton selectItemWithTitle:selectedDatabase];
- [[self onMainThread] updateWindowTitle:self];
+ [self updateWindowTitle:self];
}
} else {
if (selectedDatabase) [selectedDatabase release], selectedDatabase = nil;
[chooseDatabaseButton selectItemAtIndex:0];
- [[self onMainThread] updateWindowTitle:self];
+ [self updateWindowTitle:self];
}
}
@@ -3305,6 +3305,10 @@
*/
- (void) updateWindowTitle:(id)sender
{
+
+ // Ensure a call on the main thread
+ if (![NSThread isMainThread]) return [self updateWindowTitle:sender];
+
NSMutableString *tabTitle;
NSMutableString *windowTitle;
SPDatabaseDocument *frontTableDocument = [parentWindowController selectedTableDocument];
@@ -4543,7 +4547,7 @@
- (void)connectionControllerConnectAttemptFailed:(id)controller
{
// Reset the window title
- [[self onMainThread] updateWindowTitle:self];
+ [self updateWindowTitle:self];
}
#pragma mark -
@@ -5506,7 +5510,7 @@
[tablesListInstance setConnection:mySQLConnection];
[tableDumpInstance setConnection:mySQLConnection];
- [[self onMainThread] updateWindowTitle:self];
+ [self updateWindowTitle:self];
}
/**
@@ -5545,7 +5549,7 @@
[tablesListInstance setConnection:mySQLConnection];
[tableDumpInstance setConnection:mySQLConnection];
- [[self onMainThread] updateWindowTitle:self];
+ [self updateWindowTitle:self];
}
/**
@@ -5602,7 +5606,7 @@
[tableDumpInstance setConnection:mySQLConnection];
// Update the window title
- [[self onMainThread] updateWindowTitle:self];
+ [self updateWindowTitle:self];
// Add a history entry
if (!historyStateChanging) {
diff --git a/Source/SPDatabaseViewController.m b/Source/SPDatabaseViewController.m
index e95b6b41..a7867c53 100644
--- a/Source/SPDatabaseViewController.m
+++ b/Source/SPDatabaseViewController.m
@@ -287,7 +287,7 @@
triggersLoaded = NO;
// Update the window title
- [[self onMainThread] updateWindowTitle:self];
+ [self updateWindowTitle:self];
// Add a history entry
[spHistoryControllerInstance updateHistoryEntries];
@@ -391,7 +391,7 @@
NSString *tableEncoding = nil;
// Update the window title
- [[self onMainThread] updateWindowTitle:self];
+ [self updateWindowTitle:self];
// Reset table information caches
[tableDataInstance resetAllData];