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

If a trigger causes automatic profile switching to change the profile then...

If a trigger causes automatic profile switching to change the profile then _triggers would get deallocated. Keep triggers around for the duration of the for loop in checkTriggers and break out of it if APS fires.
parent d8dbef2e
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -1842,12 +1842,17 @@ static NSTimeInterval kMinimumPartialLineTriggerCheckInterval = 0.5;
lineNumber:(long long)startAbsLineNumber {
// If the trigger causes the session to get released, don't crash.
[[self retain] autorelease];
for (Trigger *trigger in _triggers) {
// If a trigger changes the current profile then _triggers gets released and we should stop
// processing triggers. This can happen with automatic profile switching.
NSArray<Trigger *> *triggers = [[_triggers retain] autorelease];
for (Trigger *trigger in triggers) {
BOOL stop = [trigger tryString:stringLine
inSession:self
partialLine:partial
lineNumber:startAbsLineNumber];
if (stop || _exited) {
if (stop || _exited || (_triggers != triggers)) {
break;
}
}
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