From 6734907374aef150f53e65b81f0fc2b43a8a54f7 Mon Sep 17 00:00:00 2001 From: Max Lohrmann Date: Sat, 11 Nov 2017 22:32:43 +0100 Subject: Fix a case of "background thread updating UI" (#2916) --- Source/SPExtendedTableInfo.m | 2 ++ Source/SPPrintController.m | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/SPExtendedTableInfo.m b/Source/SPExtendedTableInfo.m index dc311bdf..35a102a9 100644 --- a/Source/SPExtendedTableInfo.m +++ b/Source/SPExtendedTableInfo.m @@ -437,6 +437,8 @@ static NSString *SPMySQLCommentField = @"Comment"; /** * Returns a dictionary describing the information of the table to be used for printing purposes. + * + * MUST BE CALLED ON THE UI THREAD! */ - (NSDictionary *)tableInformationForPrinting { diff --git a/Source/SPPrintController.m b/Source/SPPrintController.m index d0feec68..8b17e5bf 100644 --- a/Source/SPPrintController.m +++ b/Source/SPPrintController.m @@ -364,7 +364,7 @@ NSString *heading = NSLocalizedString(@"Table Information", @"table information print heading"); [engine setObject:connection forKey:@"c"]; - [engine setObject:[extendedTableInfoInstance tableInformationForPrinting] forKey:@"i"]; + [engine setObject:[[extendedTableInfoInstance onMainThread] tableInformationForPrinting] forKey:@"i"]; [printData setObject:heading forKey:@"heading"]; [printData setObject:[[NSUnarchiver unarchiveObjectWithData:[prefs objectForKey:SPCustomQueryEditorFont]] fontName] forKey:@"font"]; -- cgit v1.2.3