From eedd073ec6134a822ee8c51e388f6bcec5fb6687 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Tue, 21 Jul 2009 20:51:43 +0000 Subject: - Fix a reproducible crash when exporting tables caused by a string being autoreleased; this addresses Issue #341 --- Source/TableDump.m | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'Source/TableDump.m') 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]; -- cgit v1.2.3