Skip to content

Commit

Permalink
Fix an issue that could cause Sequel Pro to become unusable when relo…
Browse files Browse the repository at this point in the history
…ading a table when at the same time editing a cell with a value that is not valid (#2816)
  • Loading branch information
dmoagx committed Jun 7, 2017
1 parent e52546b commit 38d40d0
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions Source/SPTableContent.m
Expand Up @@ -1323,20 +1323,21 @@ - (void)reloadTableTask
{
NSAutoreleasePool *reloadPool = [[NSAutoreleasePool alloc] init];

// Check whether a save of the current row is required.
if (![[self onMainThread] saveRowOnDeselect]) return;
// Check whether a save of the current row is required, abort if pending changes couldn't be saved.
if ([[self onMainThread] saveRowOnDeselect]) {

// Save view details to restore safely if possible (except viewport, which will be
// preserved automatically, and can then be scrolled as the table loads)
[self storeCurrentDetailsForRestoration];
[self setViewportToRestore:NSZeroRect];
// Save view details to restore safely if possible (except viewport, which will be
// preserved automatically, and can then be scrolled as the table loads)
[self storeCurrentDetailsForRestoration];
[self setViewportToRestore:NSZeroRect];

// Clear the table data column cache and status (including counts)
[tableDataInstance resetColumnData];
[tableDataInstance resetStatusData];
// Clear the table data column cache and status (including counts)
[tableDataInstance resetColumnData];
[tableDataInstance resetStatusData];

// Load the table's data
[self loadTable:[tablesListInstance tableName]];
// Load the table's data
[self loadTable:[tablesListInstance tableName]];
}

[tableDocumentInstance endTask];

Expand Down

0 comments on commit 38d40d0

Please sign in to comment.