From 938e8654b76383396ee187ab751bb8fa6d67f37a Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Tue, 10 Nov 2009 21:29:19 +0000 Subject: - Add safeguards to ensure sequential runs when holding down run all/run selected keys in Custom Query, preventing NSLock deadlocks - Revery MCPConnection to locking on the *current* thread when running non-streaming queries, fixing deadlocks in some situations on background threads where the main thread is locked up via a modal loop - eg CSV import windows --- Source/CustomQuery.m | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Source') diff --git a/Source/CustomQuery.m b/Source/CustomQuery.m index 55c87129..2a1492af 100644 --- a/Source/CustomQuery.m +++ b/Source/CustomQuery.m @@ -54,6 +54,9 @@ SPSQLParser *queryParser; NSArray *queries; + // Prevent multiple runs by holding the keys down + if ([tableDocumentInstance isWorking]) return; + // Fixes bug in key equivalents. if ([[NSApp currentEvent] type] == NSKeyUp) { return; @@ -108,6 +111,9 @@ NSRange selectedRange = [textView selectedRange]; SPSQLParser *queryParser; + // Prevent multiple runs by holding the keys down + if ([tableDocumentInstance isWorking]) return; + // If the current selection is a single caret position, run the current query. if (selectedRange.length == 0) { // BOOL doLookBehind = YES; -- cgit v1.2.3