From d1d0967f7e534bc36533470f2a0a93c69213db61 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Mon, 30 Aug 2010 22:40:43 +0000 Subject: - Attempt more status checking before closing the MySQL connection, in an attempt to further address http://spbug.com/l/13 - Update localisable strings --- Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Frameworks') diff --git a/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m b/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m index d7cd1fba..65545f77 100644 --- a/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m +++ b/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m @@ -456,7 +456,7 @@ static BOOL sTruncateLongFieldInLogs = YES; // Small pause for cleanup. usleep(100000); - mysql_close(mConnection); + if (mConnection->net.vio && mConnection->net.buff) mysql_close(mConnection); mConnection = NULL; } @@ -495,7 +495,7 @@ static BOOL sTruncateLongFieldInLogs = YES; // Close the connection if it exists. if (mConnected) { - mysql_close(mConnection); + if (mConnection->net.vio && mConnection->net.buff) mysql_close(mConnection); mConnection = NULL; } @@ -1220,7 +1220,7 @@ void performThreadedKeepAlive(void *ptr) if (mConnected) { // Disconnect if it was already connected - mysql_close(mConnection); + if (mConnection->net.vio && mConnection->net.buff) mysql_close(mConnection); mConnection = NULL; mConnected = NO; [self init]; -- cgit v1.2.3