From 343dc13be9aadb459444b648916e859ec5b18b9b Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Mon, 11 Jun 2012 14:22:32 +0000 Subject: - Retain the new SPDatabaseData defaultCharacterSetEncoding when created, fixing overrelease crashing on exit --- Source/SPDatabaseData.m | 2 +- Source/SPDatabaseDocument.m | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/SPDatabaseData.m b/Source/SPDatabaseData.m index a49248d1..4c99b97e 100644 --- a/Source/SPDatabaseData.m +++ b/Source/SPDatabaseData.m @@ -299,7 +299,7 @@ NSInteger _sortStorageEngineEntry(NSDictionary *itemOne, NSDictionary *itemTwo, [result setReturnDataAsStrings:YES]; - defaultCharacterSetEncoding = [[result getRowAsDictionary] objectForKey:@"Value"]; + defaultCharacterSetEncoding = [[[result getRowAsDictionary] objectForKey:@"Value"] retain]; } return defaultCharacterSetEncoding; diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index 4f4deaca..7c7d2a39 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -1591,7 +1591,7 @@ static NSString *SPRenameDatabaseAction = @"SPRenameDatabase"; NSString *mysqlEncoding = [databaseDataInstance getDatabaseDefaultCharacterSet]; - [selectedDatabaseEncoding release]; + [selectedDatabaseEncoding release], selectedDatabaseEncoding = nil; // Fallback or older version? -> set encoding to mysql default encoding latin1 if (!mysqlEncoding) { -- cgit v1.2.3