Skip to content
Snippets Groups Projects
Commit d4aca591 authored by George Nachman's avatar George Nachman
Browse files

Don't run timers after shutdown is called--crashes when a window is closd or fullscreen toggled

parent 15100780
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -18,6 +18,7 @@
NSMutableArray *names_;
NSMutableArray *pids_;
BOOL hasSelection;
BOOL shutdown_;
}
 
@property (nonatomic, assign) BOOL hasSelection;
Loading
Loading
Loading
Loading
@@ -174,6 +174,7 @@ static const CGFloat kMargin = 4;
- (void)shutdown
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
shutdown_ = YES;
[timer_ invalidate];
[kill_ unbind:@"enabled"];
timer_ = nil;
Loading
Loading
@@ -181,6 +182,9 @@ static const CGFloat kMargin = 4;
 
- (void)updateTimer:(id)sender
{
if (shutdown_) {
return;
}
ToolWrapper *wrapper = (ToolWrapper *)[[self superview] superview];
pid_t rootPid = [[[wrapper.term currentSession] SHELL] pid];
NSSet *pids = [[ProcessCache sharedInstance] childrenOfPid:rootPid levelsToSkip:0];
Loading
Loading
@@ -208,8 +212,10 @@ static const CGFloat kMargin = 4;
 
- (void)fixCursor
{
ToolWrapper *wrapper = (ToolWrapper *)[[self superview] superview];
[[[wrapper.term currentSession] TEXTVIEW] updateCursor:[[NSApplication sharedApplication] currentEvent]];
if (!shutdown_) {
ToolWrapper *wrapper = (ToolWrapper *)[[self superview] superview];
[[[wrapper.term currentSession] TEXTVIEW] updateCursor:[[NSApplication sharedApplication] currentEvent]];
}
}
 
- (BOOL)isFlipped
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment