mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
Stop a view that was not loaded from being loaded while being removed.
Example: If GitX started in stage view and the window was closed without ever looking at the history view, then [self view] will cause the history view's nib to be loaded which kicks off loading in the rev list. Wastes a lot of CPU cycles for no reason.
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
|
||||
NSString *status;
|
||||
BOOL isBusy;
|
||||
BOOL hasViewLoaded;
|
||||
}
|
||||
|
||||
@property (readonly) __weak PBGitRepository *repository;
|
||||
|
||||
+5
-3
@@ -27,14 +27,16 @@
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void) removeView
|
||||
- (void)removeView
|
||||
{
|
||||
[self unbind:@"repository"];
|
||||
[[self view] removeFromSuperview]; // remove the current view
|
||||
if (hasViewLoaded)
|
||||
[[self view] removeFromSuperview]; // remove the current view
|
||||
}
|
||||
|
||||
- (void) awakeFromNib
|
||||
- (void)awakeFromNib
|
||||
{
|
||||
hasViewLoaded = YES;
|
||||
}
|
||||
|
||||
- (NSResponder *)firstResponder;
|
||||
|
||||
Reference in New Issue
Block a user