mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
Fix memory leaks
This commit is contained in:
@@ -30,6 +30,11 @@
|
||||
[cachedFilesController setSortDescriptors:[NSArray arrayWithObject:
|
||||
[[NSSortDescriptor alloc] initWithKey:@"path" ascending:true]]];
|
||||
}
|
||||
- (void) removeView
|
||||
{
|
||||
[webController closeView];
|
||||
[super finalize];
|
||||
}
|
||||
|
||||
- (void) setAmend:(BOOL)newAmend
|
||||
{
|
||||
|
||||
@@ -190,6 +190,10 @@
|
||||
- (void) removeView
|
||||
{
|
||||
[webView close];
|
||||
[commitController removeObserver:self forKeyPath:@"selection"];
|
||||
[treeController removeObserver:self forKeyPath:@"selection"];
|
||||
[repository removeObserver:self forKeyPath:@"currentBranch"];
|
||||
|
||||
[super removeView];
|
||||
}
|
||||
|
||||
|
||||
@@ -375,4 +375,9 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain";
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (void) finalize
|
||||
{
|
||||
NSLog(@"Dealloc of repository");
|
||||
[super finalize];
|
||||
}
|
||||
@end
|
||||
|
||||
@@ -33,6 +33,11 @@
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)windowWillClose:(NSNotification *)notification
|
||||
{
|
||||
[viewController removeView];
|
||||
}
|
||||
|
||||
- (void) setSelectedViewIndex: (int) i
|
||||
{
|
||||
selectedViewIndex = i;
|
||||
@@ -70,6 +75,7 @@
|
||||
|
||||
- (void)awakeFromNib
|
||||
{
|
||||
[[self window] setDelegate:self];
|
||||
[[self window] setAutorecalculatesContentBorderThickness:NO forEdge:NSMinYEdge];
|
||||
[[self window] setContentBorderThickness:35.0f forEdge:NSMinYEdge];
|
||||
[self showHistoryView:nil];
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
- (void) removeView
|
||||
{
|
||||
[self unbind:@"repository"];
|
||||
[[self view] removeFromSuperview]; // remove the current view
|
||||
}
|
||||
|
||||
|
||||
@@ -25,4 +25,5 @@
|
||||
@property (retain) id repository;
|
||||
|
||||
- (WebScriptObject *) script;
|
||||
- (void) closeView;
|
||||
@end
|
||||
|
||||
@@ -35,6 +35,12 @@
|
||||
return [view windowScriptObject];
|
||||
}
|
||||
|
||||
- (void) closeView
|
||||
{
|
||||
if (view)
|
||||
[view close];
|
||||
}
|
||||
|
||||
# pragma mark Delegate methods
|
||||
|
||||
- (void) webView:(id) v didFinishLoadForFrame:(id) frame
|
||||
|
||||
@@ -108,4 +108,10 @@ contextMenuItemsForElement:(NSDictionary *)element
|
||||
return [historyController valueForKeyPath:[@"repository.config." stringByAppendingString:config]];
|
||||
}
|
||||
|
||||
- (void) finalize
|
||||
{
|
||||
[historyController removeObserver:self forKeyPath:@"webCommit"];
|
||||
[super finalize];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user