From d153e73f8c1ebe5fc472966a51307ae41b9ca750 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Tue, 20 Nov 2012 00:04:35 +0000 Subject: - When a table content sort is cancelled because a row save operation fails, end the task to prevent the window from ending up in a non-responsive state. This addresses Issue #1499. --- Source/SPTableContent.m | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Source') diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m index 25830946..9cd7f205 100644 --- a/Source/SPTableContent.m +++ b/Source/SPTableContent.m @@ -1638,13 +1638,16 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper - (void)sortTableTaskWithColumn:(NSTableColumn *)tableColumn { NSAutoreleasePool *sortPool = [[NSAutoreleasePool alloc] init]; - + // Check whether a save of the current row is required. if (![[self onMainThread] saveRowOnDeselect]) { + + // If the save failed, cancel the sort task and return + [tableDocumentInstance endTask]; [sortPool drain]; return; } - + // Sets column order as tri-state descending, ascending, no sort, descending, ascending etc. order if the same // header is clicked several times if (sortCol && [[tableColumn identifier] integerValue] == [sortCol integerValue]) { -- cgit v1.2.3