aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2009-11-16 22:48:49 +0000
committerrowanbeentje <rowan@beent.je>2009-11-16 22:48:49 +0000
commitcd0ac7f9878e2649846e46f559a7ba5ee3047e72 (patch)
tree4d32023421561e3da99d43c83a7668b900622c93
parent4b6a1810ca0d306e2dd4f8740b2d49d6cc5080cf (diff)
downloadsequelpro-cd0ac7f9878e2649846e46f559a7ba5ee3047e72.tar.gz
sequelpro-cd0ac7f9878e2649846e46f559a7ba5ee3047e72.tar.bz2
sequelpro-cd0ac7f9878e2649846e46f559a7ba5ee3047e72.zip
- Make some thread safety improvements to try to address Issue #460
-rw-r--r--Frameworks/MCPKit/MCPFoundationKit/MCPStreamingResult.m2
-rw-r--r--Source/SPExtendedTableInfo.m1
-rw-r--r--Source/TablesList.m8
3 files changed, 6 insertions, 5 deletions
diff --git a/Frameworks/MCPKit/MCPFoundationKit/MCPStreamingResult.m b/Frameworks/MCPKit/MCPFoundationKit/MCPStreamingResult.m
index 26c9c0fb..99150527 100644
--- a/Frameworks/MCPKit/MCPFoundationKit/MCPStreamingResult.m
+++ b/Frameworks/MCPKit/MCPFoundationKit/MCPStreamingResult.m
@@ -364,7 +364,7 @@
/**
* Used internally to download results in a background thread
*/
- - (void)_downloadAllData
+- (void)_downloadAllData
{
NSAutoreleasePool *downloadPool = [[NSAutoreleasePool alloc] init];
MYSQL_ROW theRow;
diff --git a/Source/SPExtendedTableInfo.m b/Source/SPExtendedTableInfo.m
index 7140320e..9a84286e 100644
--- a/Source/SPExtendedTableInfo.m
+++ b/Source/SPExtendedTableInfo.m
@@ -177,6 +177,7 @@
* Load all the info for the supplied table by querying the table data instance and updaing the interface
* elements accordingly.
* Note that interface elements are also toggled in start/endDocumentTaskForTab:, with similar logic.
+ * Due to the large quantity of interface interaction in this function it is not thread-safe.
*/
- (void)loadTable:(NSString *)table
{
diff --git a/Source/TablesList.m b/Source/TablesList.m
index cb4959f5..72f7afce 100644
--- a/Source/TablesList.m
+++ b/Source/TablesList.m
@@ -629,7 +629,7 @@
[tableSourceInstance loadTable:nil];
[tableContentInstance loadTable:nil];
- [extendedTableInfoInstance loadTable:nil];
+ [extendedTableInfoInstance performSelectorOnMainThread:@selector(loadTable:) withObject:nil waitUntilDone:YES];
structureLoaded = NO;
contentLoaded = NO;
statusLoaded = NO;
@@ -773,7 +773,7 @@
contentLoaded = YES;
statusLoaded = NO;
} else if ( [tabView indexOfTabViewItem:[tabView selectedTabViewItem]] == 3 ) {
- [extendedTableInfoInstance loadTable:selectedTableName];
+ [extendedTableInfoInstance performSelectorOnMainThread:@selector(loadTable:) withObject:selectedTableName waitUntilDone:YES];
structureLoaded = NO;
contentLoaded = NO;
statusLoaded = YES;
@@ -787,7 +787,7 @@
// if we are not looking at a table or view, clear these
[tableSourceInstance loadTable:nil];
[tableContentInstance loadTable:nil];
- [extendedTableInfoInstance loadTable:nil];
+ [extendedTableInfoInstance performSelectorOnMainThread:@selector(loadTable:) withObject:nil waitUntilDone:YES];
structureLoaded = NO;
contentLoaded = NO;
statusLoaded = NO;
@@ -1450,7 +1450,7 @@
}
if ( ([tabView indexOfTabViewItem:[tabView selectedTabViewItem]] == 3) && !statusLoaded ) {
- [extendedTableInfoInstance loadTable:selectedTableName];
+ [extendedTableInfoInstance performSelectorOnMainThread:@selector(loadTable:) withObject:selectedTableName waitUntilDone:YES];
statusLoaded = YES;
}
}