diff options
author | rowanbeentje <rowan@beent.je> | 2009-07-06 22:05:39 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2009-07-06 22:05:39 +0000 |
commit | b3065d6e706a5ddc7b0345c833ad125883cded82 (patch) | |
tree | caf3e40042ed63bc2d5a223d1d892b4b698bc297 /Source/TableDump.m | |
parent | 86b104a1da6857792c1feb7dcec0d3d654fdac5f (diff) | |
download | sequelpro-b3065d6e706a5ddc7b0345c833ad125883cded82.tar.gz sequelpro-b3065d6e706a5ddc7b0345c833ad125883cded82.tar.bz2 sequelpro-b3065d6e706a5ddc7b0345c833ad125883cded82.zip |
- Fixes crashes in the CSV Field Mapping sheet caused by multiple threads and autorelease pools (fixes Issue #326)
- Reset the field mapping table list whenever it's about to be populated, fixing errors when performing imports into multi databases in the same session
Diffstat (limited to 'Source/TableDump.m')
-rw-r--r-- | Source/TableDump.m | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Source/TableDump.m b/Source/TableDump.m index 70a8f6e8..32e40700 100644 --- a/Source/TableDump.m +++ b/Source/TableDump.m @@ -384,7 +384,7 @@ //set up tableView currentRow = 0; - fieldMappingArray = nil; + if (fieldMappingArray) [fieldMappingArray release], fieldMappingArray = nil; [self setupFieldMappingArray]; [rowDownButton setEnabled:NO]; [rowUpButton setEnabled:([importArray count] > 1)]; @@ -588,6 +588,7 @@ int i; theResult = (CMMCPResult *) [mySQLConnection listTables]; if ([theResult numOfRows]) [theResult dataSeek:0]; + [fieldMappingPopup removeAllItems]; for ( i = 0 ; i < [theResult numOfRows] ; i++ ) { [fieldMappingPopup addItemWithTitle:NSArrayObjectAtIndex([theResult fetchRowAsArray], 0)]; } @@ -607,7 +608,7 @@ //set up tableView currentRow = 0; - fieldMappingArray = nil; + if (fieldMappingArray) [fieldMappingArray release], fieldMappingArray = nil; [self setupFieldMappingArray]; [rowDownButton setEnabled:NO]; [rowUpButton setEnabled:([importArray count] > 1)]; @@ -727,7 +728,7 @@ } //free arrays - fieldMappingArray = nil; + if (fieldMappingArray) [fieldMappingArray release], fieldMappingArray = nil; importArray = nil; } @@ -761,7 +762,7 @@ int i, value; if (!fieldMappingArray) { - fieldMappingArray = [NSMutableArray array]; + fieldMappingArray = [[NSMutableArray alloc] init]; for (i = 0; i < [[tableSourceInstance fieldNames] count]; i++) { if (i < [NSArrayObjectAtIndex(importArray, currentRow) count] && ![NSArrayObjectAtIndex(NSArrayObjectAtIndex(importArray, currentRow), i) isKindOfClass:[NSNull class]]) { @@ -2293,6 +2294,7 @@ objectValueForTableColumn:(NSTableColumn *)aTableColumn tables = [[NSMutableArray alloc] init]; fieldMappingButtonOptions = [[NSMutableArray alloc] init]; + fieldMappingArray = nil; return self; } @@ -2302,7 +2304,7 @@ objectValueForTableColumn:(NSTableColumn *)aTableColumn [tables release]; [importArray release]; [fieldMappingButtonOptions release]; - [fieldMappingArray release]; + if (fieldMappingArray) [fieldMappingArray release]; [savePath release]; [openPath release]; [prefs release]; |