From 0d3af5fe7631325e8a892011f0595c76b1ebd49a Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Wed, 2 May 2012 23:51:49 +0000 Subject: - Fix a crash on closing windows by deregistering controller view notifications on dealloc - Fix a crash on opening windows after closing windows due to an overrelease of the favourites tree - Fix an exception on logging in due to incorrect keychain ID type on the document --- Source/SPConnectionController.h | 2 +- Source/SPConnectionController.m | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Source/SPConnectionController.h b/Source/SPConnectionController.h index 456f8383..63df0551 100644 --- a/Source/SPConnectionController.h +++ b/Source/SPConnectionController.h @@ -171,7 +171,7 @@ NSImage *folderImage; SPTreeNode *favoritesRoot; - SPFavoriteNode *currentFavorite; + NSDictionary *currentFavorite; SPFavoritesController *favoritesController; SPFavoritesSortItem currentSortItem; #endif diff --git a/Source/SPConnectionController.m b/Source/SPConnectionController.m index e40cb80a..350616ce 100644 --- a/Source/SPConnectionController.m +++ b/Source/SPConnectionController.m @@ -528,7 +528,7 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, } // Store the selected favorite ID for use with the document on connection - if ([fav objectForKey:SPFavoriteIDKey]) connectionKeychainID = [[fav objectForKey:SPFavoriteIDKey] copy]; + if ([fav objectForKey:SPFavoriteIDKey]) connectionKeychainID = [[[fav objectForKey:SPFavoriteIDKey] stringValue] retain]; // And the same for the SSH password connectionSSHKeychainItemName = [[keychain nameForSSHForFavoriteName:[fav objectForKey:SPFavoriteNameKey] id:[fav objectForKey:SPFavoriteIDKey]] retain]; @@ -1456,6 +1456,8 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, - (void)dealloc { + [[NSNotificationCenter defaultCenter] removeObserver:self]; + [keychain release]; [prefs release]; @@ -1475,7 +1477,6 @@ static NSComparisonResult _compareFavoritesUsingKey(id favorite1, id favorite2, if (connectionSSHKeychainItemAccount) [connectionSSHKeychainItemAccount release]; if (currentFavorite) [currentFavorite release], currentFavorite = nil; - if (favoritesRoot) [favoritesRoot release], favoritesRoot = nil; [super dealloc]; } -- cgit v1.2.3