Permalink
Browse files

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 8b6dc62de2cd4a3d6f61bece6dcd259610422adb
Showing with 2 additions and 2 deletions.
  1. +2 −2 Source/SPDataImport.m
View
@@ -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]];
@@ -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];

2 comments on commit 8b6dc62

@neokio

This comment has been minimized.

Show comment
Hide comment
@neokio

neokio Mar 16, 2017

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

neokio replied Mar 16, 2017

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

@dmoagx

This comment has been minimized.

Show comment
Hide comment
@dmoagx

dmoagx Mar 16, 2017

Member

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)

Member

dmoagx replied Mar 16, 2017

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.