aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/TableDocument.m6
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/TableDocument.m b/Source/TableDocument.m
index 8e7ba817..2ce0ef9e 100644
--- a/Source/TableDocument.m
+++ b/Source/TableDocument.m
@@ -1398,6 +1398,12 @@
- (void) endTask
{
+ // Ensure a call on the main thread
+ if (![NSThread isMainThread]) {
+ [self performSelectorOnMainThread:@selector(endTask) withObject:nil waitUntilDone:YES];
+ return;
+ }
+
// Decrement the working level
_isWorkingLevel--;