From b5e1e22acd6ac35507b66bd944b33d68eb3f368a Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Wed, 10 Mar 2010 02:27:21 +0000 Subject: - Ensure endTask is called on the main thread, fixing various thread-safety issues including http://log.sequelpro.com/view/40 and http://log.sequelpro.com/view/21 --- Source/TableDocument.m | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Source') 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--; -- cgit v1.2.3