aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2009-11-10 21:29:19 +0000
committerrowanbeentje <rowan@beent.je>2009-11-10 21:29:19 +0000
commit938e8654b76383396ee187ab751bb8fa6d67f37a (patch)
tree3aaf8a7df7fb3582663adee8a0227091f5cd2bcf /Source
parente122d2c8e45b19982b9b62b9b0ec39248d1d0bd4 (diff)
downloadsequelpro-938e8654b76383396ee187ab751bb8fa6d67f37a.tar.gz
sequelpro-938e8654b76383396ee187ab751bb8fa6d67f37a.tar.bz2
sequelpro-938e8654b76383396ee187ab751bb8fa6d67f37a.zip
- 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
Diffstat (limited to 'Source')
-rw-r--r--Source/CustomQuery.m6
1 files changed, 6 insertions, 0 deletions
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;