From b39eb93c5dfb9e0329b008b722e1ea96df1f216c Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 6 Nov 2015 00:27:58 +0100 Subject: Fix another case of "background thread updating UI" backport of 27763d429365c0127198f2e9abdd488a61c9f41e --- Source/SPDatabaseDocument.m | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index 05eec2ed..fd61172f 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -5034,20 +5034,23 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; } // Select view + SEL viewAction = NULL; if([[spfSession objectForKey:@"view"] isEqualToString:@"SP_VIEW_STRUCTURE"]) - [self viewStructure:self]; + viewAction = @selector(viewStructure:); else if([[spfSession objectForKey:@"view"] isEqualToString:@"SP_VIEW_CONTENT"]) - [self viewContent:self]; + viewAction = @selector(viewContent:); else if([[spfSession objectForKey:@"view"] isEqualToString:@"SP_VIEW_CUSTOMQUERY"]) - [self viewQuery:self]; + viewAction = @selector(viewQuery:); else if([[spfSession objectForKey:@"view"] isEqualToString:@"SP_VIEW_STATUS"]) - [self viewStatus:self]; + viewAction = @selector(viewStatus:); else if([[spfSession objectForKey:@"view"] isEqualToString:@"SP_VIEW_RELATIONS"]) - [self viewRelations:self]; + viewAction = @selector(viewRelations:); else if([[spfSession objectForKey:@"view"] isEqualToString:@"SP_VIEW_TRIGGERS"]) - [self viewTriggers:self]; + viewAction = @selector(viewTriggers:); + + if(viewAction) [self performSelectorOnMainThread:viewAction withObject:self waitUntilDone:YES]; - [self updateWindowTitle:self]; + [[self onMainThread] updateWindowTitle:self]; // dealloc spfSession data SPClear(spfSession); -- cgit v1.2.3