From fd4305711129a5b6a5ff4571f2b39295bcddf831 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Mon, 7 Feb 2011 02:14:49 +0000 Subject: - 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. --- Source/SPDatabaseViewController.m | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Source/SPDatabaseViewController.m') 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]; -- cgit v1.2.3