From fa32739de8f7ea821ee83ec2e5c7f51f5eb3e0c0 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Tue, 23 Mar 2010 00:23:11 +0000 Subject: - Fix a crash when connecting to a non-existant database by cleaning up dealloc/unlock procedure. Addresses http://log.sequelpro.com/view/73 --- Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m') diff --git a/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m b/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m index 7f5c4365..7c7de35f 100644 --- a/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m +++ b/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m @@ -2461,10 +2461,8 @@ void performThreadedKeepAlive(void *ptr) { delegate = nil; - // Release the query lock, after unlocking it - [queryLock tryLock]; - [queryLock unlock]; - [queryLock release]; + // Ensure the query lock is unlocked + [self unlockConnection]; // Clean up connections if necessary if (mConnected) [self disconnect]; @@ -2473,6 +2471,7 @@ void performThreadedKeepAlive(void *ptr) [connectionProxy disconnect]; } + [queryLock release]; if (lastQueryErrorMessage) [lastQueryErrorMessage release]; if (connectionHost) [connectionHost release]; if (connectionLogin) [connectionLogin release]; -- cgit v1.2.3