aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPFavoritesController.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2012-05-02 19:36:58 +0000
committerstuconnolly <stuart02@gmail.com>2012-05-02 19:36:58 +0000
commit74843eab993bd3aac144f2d6ce5e69f76b002bd2 (patch)
tree979491b96551c262321a530d9d16ab3400a7dfb9 /Source/SPFavoritesController.m
parentf04710798a01782fddd4f7e848d8a534dedb2e7e (diff)
downloadsequelpro-74843eab993bd3aac144f2d6ce5e69f76b002bd2.tar.gz
sequelpro-74843eab993bd3aac144f2d6ce5e69f76b002bd2.tar.bz2
sequelpro-74843eab993bd3aac144f2d6ce5e69f76b002bd2.zip
Fix memory leaks.
Diffstat (limited to 'Source/SPFavoritesController.m')
-rw-r--r--Source/SPFavoritesController.m12
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/SPFavoritesController.m b/Source/SPFavoritesController.m
index c53bbae3..45eb5c9a 100644
--- a/Source/SPFavoritesController.m
+++ b/Source/SPFavoritesController.m
@@ -273,8 +273,6 @@ static SPFavoritesController *sharedFavoritesController = nil;
SPTreeNode *node = [self _constructBranchForNodeData:favorite];
[[favoritesNode mutableChildNodes] addObject:node];
-
- [node release];
}
[[rootNode mutableChildNodes] addObject:favoritesNode];
@@ -307,24 +305,26 @@ static SPFavoritesController *sharedFavoritesController = nil;
treeNode = [[SPTreeNode alloc] initWithRepresentedObject:node];
+ [node release];
+
[treeNode setIsGroup:YES];
for (NSDictionary *favorite in [nodeData objectForKey:SPFavoriteChildrenKey])
{
SPTreeNode *innerNode = [self _constructBranchForNodeData:favorite];
- [[treeNode mutableChildNodes] addObject:innerNode];
-
- [innerNode release];
+ [[treeNode mutableChildNodes] addObject:innerNode];
}
}
else {
node = [[SPFavoriteNode alloc] initWithDictionary:nodeData];
treeNode = [[SPTreeNode alloc] initWithRepresentedObject:node];
+
+ [node release];
}
- return treeNode;
+ return [treeNode autorelease];
}
/**