diff options
author | Owen Williams <owilliams@mixxx.org> | 2022-01-15 22:30:34 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-15 22:30:34 -0500 |
commit | d42768131afc3659e803e62a89dcf7db45703bae (patch) | |
tree | d19ddca37fed2420a819934ec4d5b87d6142c090 | |
parent | 68978853a3ade2b8cdd39ac5555760f5b73b5689 (diff) | |
parent | 418a574c24ce17c756e666f7d313f62c3e1d5010 (diff) |
Merge pull request #4627 from Holzhaus/controllerscriptinterfacelegacy-qhash-fix
ControllerScriptInterfaceLegacy: Do not modify QHash while iterating over it
-rw-r--r-- | src/controllers/scripting/legacy/controllerscriptinterfacelegacy.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/controllers/scripting/legacy/controllerscriptinterfacelegacy.cpp b/src/controllers/scripting/legacy/controllerscriptinterfacelegacy.cpp index 3ed6b54dd0..958cdadda5 100644 --- a/src/controllers/scripting/legacy/controllerscriptinterfacelegacy.cpp +++ b/src/controllers/scripting/legacy/controllerscriptinterfacelegacy.cpp @@ -42,10 +42,9 @@ ControllerScriptInterfaceLegacy::ControllerScriptInterfaceLegacy( ControllerScriptInterfaceLegacy::~ControllerScriptInterfaceLegacy() { // Stop all timers - QMutableHashIterator<int, TimerInfo> i(m_timers); - while (i.hasNext()) { - i.next(); - stopTimer(i.key()); + const auto timerIds = m_timers.keys(); + for (const int timerId : timerIds) { + stopTimer(timerId); } // Prevents leaving decks in an unstable state |