diff options
-rw-r--r-- | Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m | 6 | ||||
-rw-r--r-- | Source/TableDocument.m | 2 |
2 files changed, 5 insertions, 3 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]; } diff --git a/Source/TableDocument.m b/Source/TableDocument.m index 273612de..88578b08 100644 --- a/Source/TableDocument.m +++ b/Source/TableDocument.m @@ -682,7 +682,7 @@ notificationName:@"Connected"]; // Query the structure of all databases in the background (mainly for completion) - [mySQLConnection performSelector:@selector(queryDbStructure) withObject:nil afterDelay:0.5]; + [NSThread detachNewThreadSelector:@selector(queryDbStructure) toTarget:mySQLConnection withObject:nil]; // Init Custom Query editor with the stored queries in a spf file if given. [spfDocData setObject:[NSNumber numberWithBool:NO] forKey:@"save_editor_content"]; |