aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPDatabaseViewController.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2011-02-07 02:14:49 +0000
committerrowanbeentje <rowan@beent.je>2011-02-07 02:14:49 +0000
commitfd4305711129a5b6a5ff4571f2b39295bcddf831 (patch)
tree837a83700e6efb82a57a98a856a6ce6b38c9eeb0 /Source/SPDatabaseViewController.m
parent08b720c2e20115fb0770902f4609f9345d2c3bb9 (diff)
downloadsequelpro-fd4305711129a5b6a5ff4571f2b39295bcddf831.tar.gz
sequelpro-fd4305711129a5b6a5ff4571f2b39295bcddf831.tar.bz2
sequelpro-fd4305711129a5b6a5ff4571f2b39295bcddf831.zip
- Ensure table information is retrieved on the working thread, to prevent a possible race condition where the main thread may retrieve table info as a result of a notification as well as the working thread. This may improve Issue #974.
Diffstat (limited to 'Source/SPDatabaseViewController.m')
-rw-r--r--Source/SPDatabaseViewController.m6
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/SPDatabaseViewController.m b/Source/SPDatabaseViewController.m
index a7867c53..03153230 100644
--- a/Source/SPDatabaseViewController.m
+++ b/Source/SPDatabaseViewController.m
@@ -426,6 +426,12 @@
if (changeEncoding) [mySQLConnection restoreStoredEncoding];
+ // Cache table information on the working thread
+ if (selectedTableType == SPTableTypeView)
+ [tableDataInstance updateInformationForCurrentView];
+ else
+ [tableDataInstance updateInformationForCurrentTable];
+
// Notify listeners of the table change now that the state is fully set up.
[[NSNotificationCenter defaultCenter] postNotificationOnMainThreadWithName:SPTableChangedNotification object:self];