-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MIDI for light: Fix unsound timer handling #13117
Conversation
engine.stopTimer(midi_for_light.deck_beat_watchdog_timer[0]); | ||
engine.stopTimer(midi_for_light.deck_beat_watchdog_timer[1]); | ||
engine.stopTimer(midi_for_light.deck_beat_watchdog_timer[2]); | ||
engine.stopTimer(midi_for_light.deck_beat_watchdog_timer[3]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this likely didn't work in the first place. deck_beat_watchdog_timer
is a free variable, not a member of midi_for_light
. It was probably never noticed being part of the rarely invoked shutdown handler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error can be reproduced by selecting the MIDI for light mapping and then switching to another mapping (which errors)
The `[-1, -1]` value is likely taken from other scripts where the variable actually holds an array of timers. This is not the case here, so to prevent confusion, we shouldn't use an array where we intend to assign a timer.
fd9470d
to
9cfdbd6
Compare
This should fix the remaining "Tried to kill non-existent timer" errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The entire script is a mess, so LGTM I guess 🤷♂️
Should this be merged then? |
Yes |
Ah this still targeted 2.4, so we might need another merge to 2.5 |
This is a first attempt at fixing #13114.
Maybe someone more familiar with the legacy controller scripting system can comment on this, the timer handling in the script did not look sound, so I tried to ensure that timers are only stopped if they are running and that they are unassigned properly if stopped.