aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2010-05-09 22:54:56 +0000
committerrowanbeentje <rowan@beent.je>2010-05-09 22:54:56 +0000
commit1f3218fff6d606d4cc9a9bd3bcef0919fa536fda (patch)
treeab76b0855c1eaeeb9a0e61c73b080babe3b47ea7 /Source
parent91fe90f0f75cbfd14933f00c40e8cee17937b30c (diff)
downloadsequelpro-1f3218fff6d606d4cc9a9bd3bcef0919fa536fda.tar.gz
sequelpro-1f3218fff6d606d4cc9a9bd3bcef0919fa536fda.tar.bz2
sequelpro-1f3218fff6d606d4cc9a9bd3bcef0919fa536fda.zip
- In the CSV import field mapper controller, retain the primary key field to fix an autorelease crash. (Addresses http://spbug.com/l/266 )
Diffstat (limited to 'Source')
-rw-r--r--Source/SPFieldMapperController.m4
1 files changed, 3 insertions, 1 deletions
diff --git a/Source/SPFieldMapperController.m b/Source/SPFieldMapperController.m
index 290040a8..0a51e20f 100644
--- a/Source/SPFieldMapperController.m
+++ b/Source/SPFieldMapperController.m
@@ -160,6 +160,7 @@
if (fieldMappingGlobalValues) [fieldMappingGlobalValues release];
if (fieldMappingGlobalValuesSQLMarked) [fieldMappingGlobalValuesSQLMarked release];
if (fieldMappingTableDefaultValues) [fieldMappingTableDefaultValues release];
+ if (primaryKeyField) [primaryKeyField release];
[super dealloc];
}
@@ -356,7 +357,8 @@
[fieldMappingTableDefaultValues addObject:@"0"];
}
targetTableHasPrimaryKey = YES;
- primaryKeyField = [tableDetails objectForKey:@"primarykeyfield"];
+ if (primaryKeyField) [primaryKeyField release];
+ primaryKeyField = [[tableDetails objectForKey:@"primarykeyfield"] retain];
} else {
if([column objectForKey:@"unique"]) {
[type appendFormat:@",%@",@"UNIQUE"];