diff options
author | rowanbeentje <rowan@beent.je> | 2009-07-21 20:51:43 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2009-07-21 20:51:43 +0000 |
commit | eedd073ec6134a822ee8c51e388f6bcec5fb6687 (patch) | |
tree | 0613a34ef2823e654edc0a09dc055cd199f7117a | |
parent | 23de25f49c94fbc3fb4d9ab22a041044ed668c30 (diff) | |
download | sequelpro-eedd073ec6134a822ee8c51e388f6bcec5fb6687.tar.gz sequelpro-eedd073ec6134a822ee8c51e388f6bcec5fb6687.tar.bz2 sequelpro-eedd073ec6134a822ee8c51e388f6bcec5fb6687.zip |
- Fix a reproducible crash when exporting tables caused by a string being autoreleased; this addresses Issue #341
-rw-r--r-- | Source/TableDump.m | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Source/TableDump.m b/Source/TableDump.m index 7f65196d..3edf0619 100644 --- a/Source/TableDump.m +++ b/Source/TableDump.m @@ -902,7 +902,7 @@ [fileHandle writeData:[metaString dataUsingEncoding:NSUTF8StringEncoding]]; // Store the current connection encoding so it can be restored after the dump. - previousConnectionEncoding = [tableDocumentInstance connectionEncoding]; + previousConnectionEncoding = [[NSString alloc] initWithString:[tableDocumentInstance connectionEncoding]]; previousConnectionEncodingViaLatin1 = [tableDocumentInstance connectionEncodingViaLatin1:nil]; // Set the connection to UTF8 to be able to export correctly. @@ -1128,6 +1128,7 @@ [tableDocumentInstance setConnectionEncoding:[NSString stringWithFormat:@"%@%@", previousConnectionEncoding, previousConnectionEncodingViaLatin1?@"-":@""] reloadingViews:NO]; + [previousConnectionEncoding release]; // Close the progress sheet [NSApp endSheet:singleProgressSheet]; @@ -1195,7 +1196,7 @@ [fileHandle writeData:[metaString dataUsingEncoding:NSUTF8StringEncoding]]; // store connection encoding - previousConnectionEncoding = [tableDocumentInstance connectionEncoding]; + previousConnectionEncoding = [[NSString alloc] initWithString:[tableDocumentInstance connectionEncoding]]; previousConnectionEncodingViaLatin1 = [tableDocumentInstance connectionEncodingViaLatin1:nil]; NSMutableArray *fkInfo = [[NSMutableArray alloc] init]; @@ -1283,7 +1284,8 @@ [tableDocumentInstance setConnectionEncoding:[NSString stringWithFormat:@"%@%@", previousConnectionEncoding, previousConnectionEncodingViaLatin1?@"-":@""] reloadingViews:NO]; - + [previousConnectionEncoding release]; + // Close the progress sheet [NSApp endSheet:singleProgressSheet]; |