aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2012-05-02 23:51:49 +0000
committerrowanbeentje <rowan@beent.je>2012-05-02 23:51:49 +0000
commit0d3af5fe7631325e8a892011f0595c76b1ebd49a (patch)
tree530901f89f43004c8c210ce481d0849a07d16bec
parent8b91b2898889f60a79525d4c123620a323156021 (diff)
downloadsequelpro-0d3af5fe7631325e8a892011f0595c76b1ebd49a.tar.gz
sequelpro-0d3af5fe7631325e8a892011f0595c76b1ebd49a.tar.bz2
sequelpro-0d3af5fe7631325e8a892011f0595c76b1ebd49a.zip
- 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
-rw-r--r--Source/SPConnectionController.h2
-rw-r--r--Source/SPConnectionController.m5
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];
}