aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPTableContent.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2012-11-20 00:04:35 +0000
committerrowanbeentje <rowan@beent.je>2012-11-20 00:04:35 +0000
commitd153e73f8c1ebe5fc472966a51307ae41b9ca750 (patch)
tree6a3d7105b6a3d0c12ef45754bb128a1440157211 /Source/SPTableContent.m
parentddc615f88f34276294e2bf2e9fbe759637f4c9f7 (diff)
downloadsequelpro-d153e73f8c1ebe5fc472966a51307ae41b9ca750.tar.gz
sequelpro-d153e73f8c1ebe5fc472966a51307ae41b9ca750.tar.bz2
sequelpro-d153e73f8c1ebe5fc472966a51307ae41b9ca750.zip
- 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.
Diffstat (limited to 'Source/SPTableContent.m')
-rw-r--r--Source/SPTableContent.m7
1 files changed, 5 insertions, 2 deletions
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]) {