diff options
author | Bibiko <bibiko@eva.mpg.de> | 2010-03-29 14:22:37 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2010-03-29 14:22:37 +0000 |
commit | d8f38f5740abe258fbcf339c6a666415e67feb57 (patch) | |
tree | 3151afe8da1bac83569d77c18e988a0fc986f0de /Frameworks/MCPKit/MCPFoundationKit | |
parent | e9220681f3ad83c507ffd075844eab702f08405b (diff) | |
download | sequelpro-d8f38f5740abe258fbcf339c6a666415e67feb57.tar.gz sequelpro-d8f38f5740abe258fbcf339c6a666415e67feb57.tar.bz2 sequelpro-d8f38f5740abe258fbcf339c6a666415e67feb57.zip |
• added some more sanity checks to avoid exceptions due to threading
Diffstat (limited to 'Frameworks/MCPKit/MCPFoundationKit')
-rw-r--r-- | Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m b/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m index 683cda7d..c4d41778 100644 --- a/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m +++ b/Frameworks/MCPKit/MCPFoundationKit/MCPConnection.m @@ -1877,10 +1877,16 @@ void performThreadedKeepAlive(void *ptr) connectionID = @"_"; // Re-init with already cached data from navigator controller + NSDictionary *dbstructure = [[[self delegate] getDbStructure] retain]; [structure removeAllObjects]; - [structure setObject:[NSMutableDictionary dictionaryWithDictionary:[[self delegate] getDbStructure]] forKey:connectionID]; - [allKeysofDbStructure removeAllObjects]; - [allKeysofDbStructure addObjectsFromArray:[[self delegate] allSchemaKeys]]; + [structure setObject:[NSMutableDictionary dictionaryWithDictionary:dbstructure] forKey:connectionID]; + NSArray *allStructureKeys = [[[self delegate] allSchemaKeys] retain]; + if(allStructureKeys && [allStructureKeys count]) { + [allKeysofDbStructure removeAllObjects]; + [allKeysofDbStructure addObjectsFromArray:allStructureKeys]; + } + if(allStructureKeys) [allStructureKeys release], allStructureKeys = nil; + if(dbstructure) [dbstructure release], dbstructure = nil; BOOL removeAddFlag = NO; |