aboutsummaryrefslogtreecommitdiffstats
path: root/Frameworks
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2010-01-12 00:58:17 +0000
committerrowanbeentje <rowan@beent.je>2010-01-12 00:58:17 +0000
commit21f0846b7ad5f3b1c755ae4f31fd68f6975bda7f (patch)
tree3c9f8a1226cd952e4c4b94099ba97b593e28ea18 /Frameworks
parent703e78c5b147261417718d56281e91603b1e8356 (diff)
downloadsequelpro-21f0846b7ad5f3b1c755ae4f31fd68f6975bda7f.tar.gz
sequelpro-21f0846b7ad5f3b1c755ae4f31fd68f6975bda7f.tar.bz2
sequelpro-21f0846b7ad5f3b1c755ae4f31fd68f6975bda7f.zip
- Move the query for the database structure to a background processing thread, as well as the existing background database connection, for a smoother experience
Diffstat (limited to 'Frameworks')
-rw-r--r--Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m6
1 files changed, 4 insertions, 2 deletions
diff --git a/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m b/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m
index 7cb10674..3e17944f 100644
--- a/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m
+++ b/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m
@@ -1811,8 +1811,7 @@ void performThreadedKeepAlive(void *ptr)
*/
- (void)queryDbStructure
{
-
- // return;
+ NSAutoreleasePool *queryPool = [[NSAutoreleasePool alloc] init];
if (!isQueryingDbStructure && [self serverMajorVersion] >= 5) {
@@ -1863,6 +1862,7 @@ void performThreadedKeepAlive(void *ptr)
unsigned long setNameCStringLength = [encodedSetNameData length];
if (mysql_real_query(structConnection, setNameCString, setNameCStringLength) != 0) {
isQueryingDbStructure = NO;
+ [queryPool release];
return;
}
@@ -1914,6 +1914,7 @@ void performThreadedKeepAlive(void *ptr)
theDbStructure = [[NSDictionary dictionaryWithDictionary:structure] retain];
isQueryingDbStructure = NO;
+ [queryPool release];
return;
}
mysql_close(structConnection);
@@ -1922,6 +1923,7 @@ void performThreadedKeepAlive(void *ptr)
}
}
+ [queryPool release];
}