From 79bba63e1bed358c458f49351d8c4836c0fec20b Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Mon, 11 Jul 2011 00:29:00 +0000 Subject: - Fix thread-safety issues creating the encoding popupbuttoncell on the Structure view (addresses http://spbug.com/l/2123 ) --- Source/SPTableStructure.m | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/SPTableStructure.m b/Source/SPTableStructure.m index 618b37b4..0f5222a0 100644 --- a/Source/SPTableStructure.m +++ b/Source/SPTableStructure.m @@ -296,16 +296,16 @@ // Set up the encoding PopUpButtonCell NSArray *encodings = [databaseDataInstance getDatabaseCharacterSetEncodings]; if ([encodings count]) { - [encodingPopupCell removeAllItems]; - [encodingPopupCell addItemWithTitle:@""]; + [[encodingPopupCell onMainThread] removeAllItems]; + [[encodingPopupCell onMainThread] addItemWithTitle:@""]; // Populate encoding popup button for (NSDictionary *encoding in encodings) - [encodingPopupCell addItemWithTitle:(![encoding objectForKey:@"DESCRIPTION"]) ? [encoding objectForKey:@"CHARACTER_SET_NAME"] : [NSString stringWithFormat:@"%@ (%@)", [encoding objectForKey:@"DESCRIPTION"], [encoding objectForKey:@"CHARACTER_SET_NAME"]]]; + [[encodingPopupCell onMainThread] addItemWithTitle:(![encoding objectForKey:@"DESCRIPTION"]) ? [encoding objectForKey:@"CHARACTER_SET_NAME"] : [NSString stringWithFormat:@"%@ (%@)", [encoding objectForKey:@"DESCRIPTION"], [encoding objectForKey:@"CHARACTER_SET_NAME"]]]; } else { - [encodingPopupCell addItemWithTitle:NSLocalizedString(@"Not available", @"not available label")]; + [[encodingPopupCell onMainThread] addItemWithTitle:NSLocalizedString(@"Not available", @"not available label")]; } // Process all the fields to normalise keys and add additional information -- cgit v1.2.3