Skip to content

Commit

Permalink
ControllerScriptEngineLegacy: avoid debug asserts with new, file-less…
Browse files Browse the repository at this point in the history
… mapping
  • Loading branch information
ronso0 committed Aug 25, 2022
1 parent 3c1f16e commit 06ac0df
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,17 @@ bool ControllerScriptEngineLegacy::initialize() {
}

void ControllerScriptEngineLegacy::shutdown() {
callFunctionOnObjects(m_scriptFunctionPrefixes, "shutdown");
// There is no js engine if the mapping was not loaded from a file but by
// creating a new, empty mapping LegacyMidiControllerMapping with the wizard
if (m_pJSEngine) {
callFunctionOnObjects(m_scriptFunctionPrefixes, "shutdown");
}
m_scriptWrappedFunctionCache.clear();
m_incomingDataFunctions.clear();
m_scriptFunctionPrefixes.clear();
ControllerScriptEngineBase::shutdown();
if (m_pJSEngine) {
ControllerScriptEngineBase::shutdown();
}
}

bool ControllerScriptEngineLegacy::handleIncomingData(const QByteArray& data) {
Expand Down

0 comments on commit 06ac0df

Please sign in to comment.