From 1f3218fff6d606d4cc9a9bd3bcef0919fa536fda Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Sun, 9 May 2010 22:54:56 +0000 Subject: - In the CSV import field mapper controller, retain the primary key field to fix an autorelease crash. (Addresses http://spbug.com/l/266 ) --- Source/SPFieldMapperController.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Source') 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"]; -- cgit v1.2.3