lang: Do not re-reset nowExecutingPath when stopping a routine #2620
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #2540. Also, I've been running with this change for about a month, with no problem.
It might look strange to remove a state reset upon stop, but the line is redundant.
The Routine object's oldExecutingPath variable is set only when entering the routine, by
next
. This is correct: If the routine is sleeping, then there is no oldExecutingPath.oldExecutingPath is, therefore, valid only when the routine is in state
tRunning
. (Routine states: https://github.com/supercollider/supercollider/blob/master/lang/LangSource/PyrKernel.h#L105 )The branch where I'm removing the line is only for states
tSuspended
ortInit
.So, oldExecutingPath is invalid here, and we shouldn't be putting invalid data into the interpreter's state.
Note also that it's forbidden to stop a routine while the same routine is running: https://github.com/supercollider/supercollider/blob/master/lang/LangPrimSource/PyrPrimitive.cpp#L3368