Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix two cases of background thread updating UI (could cause a concurr…
…ent modification exception)
  • Loading branch information
dmoagx committed Mar 16, 2017
1 parent 98e4a6f commit 8b6dc62
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/SPDataImport.m
Expand Up @@ -1092,7 +1092,7 @@ - (void)importCSVFile:(NSString *)filename
[query release];

if ([mySQLConnection queryErrored]) {
[tableDocumentInstance showConsole:nil];
[[tableDocumentInstance onMainThread] showConsole:nil];
[errors appendFormat:
NSLocalizedString(@"[ERROR in row %ld] %@\n", @"error text when reading of csv file gave errors"),
(long)(rowsImported+1),[mySQLConnection lastErrorMessage]];
Expand Down Expand Up @@ -1132,7 +1132,7 @@ - (void)importCSVFile:(NSString *)filename

// If an error occurred, run the queries individually to get exact line errors
if (!importMethodIsUpdate && [mySQLConnection queryErrored]) {
[tableDocumentInstance showConsole:nil];
[[tableDocumentInstance onMainThread] showConsole:nil];
for (i = 0; i < csvRowsThisQuery; i++) {
if (progressCancelled) break;
query = [[NSMutableString alloc] initWithString:insertBaseString];
Expand Down

2 comments on commit 8b6dc62

@designosis
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fairly certain this commit just made Sequel Pro between 5-10x more responsive/snappy.
I can't thank you enough!

@dmoagx
Copy link
Member Author

@dmoagx dmoagx commented on 8b6dc62 Mar 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, but I'm pretty sure that was something else :)

That commit only affected the CSV import and is only supposed to fix a crash.

Perhaps you had a large Query in your Query History and it got rotated out by more recent queries. (See #687)

Please sign in to comment.