Permalink
Browse files

Fix an issue that could cause Sequel Pro to become unusable when relo…

…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 38d40d03969967a186ec57f86cd257ff4dab9fd0
Showing with 12 additions and 11 deletions.
  1. +12 −11 Source/SPTableContent.m
View
@@ -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];

0 comments on commit 38d40d0

Please sign in to comment.