aboutsummaryrefslogtreecommitdiffstats
path: root/Source/TableDump.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2009-07-21 20:51:43 +0000
committerrowanbeentje <rowan@beent.je>2009-07-21 20:51:43 +0000
commiteedd073ec6134a822ee8c51e388f6bcec5fb6687 (patch)
tree0613a34ef2823e654edc0a09dc055cd199f7117a /Source/TableDump.m
parent23de25f49c94fbc3fb4d9ab22a041044ed668c30 (diff)
downloadsequelpro-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
Diffstat (limited to 'Source/TableDump.m')
-rw-r--r--Source/TableDump.m8
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];