Fixes persistent crashes when quitting MuseScore

This commit is contained in:
wizofaus@hotmail.com 2021-06-15 13:58:26 +10:00
parent c471317b40
commit 440ad765fb
2 changed files with 13 additions and 12 deletions

View file

@ -292,7 +292,7 @@ void DockBase::listenFloatingChanges()
} }
connect(m_dockWidget, &KDDockWidgets::DockWidgetQuick::parentChanged, [this]() { connect(m_dockWidget, &KDDockWidgets::DockWidgetQuick::parentChanged, [this]() {
if (!m_dockWidget->parentItem()) { if (!m_dockWidget || !m_dockWidget->parentItem()) {
return; return;
} }

View file

@ -1279,18 +1279,19 @@ void NotationUiActions::init()
} }
m_actionCheckedChanged.send(actions); m_actionCheckedChanged.send(actions);
m_controller->currentNotationInteraction()->scoreConfigChanged().onReceive(this, [this](ScoreConfigType configType) { if (m_controller->currentNotationInteraction()) {
static const std::unordered_map<ScoreConfigType, std::string> configActions = { m_controller->currentNotationInteraction()->scoreConfigChanged().onReceive(this, [this](ScoreConfigType configType) {
{ ScoreConfigType::ShowInvisibleElements, SHOW_INVISIBLE_CODE }, static const std::unordered_map<ScoreConfigType, std::string> configActions = {
{ ScoreConfigType::ShowUnprintableElements, SHOW_UNPRINTABLE_CODE }, { ScoreConfigType::ShowInvisibleElements, SHOW_INVISIBLE_CODE },
{ ScoreConfigType::ShowFrames, SHOW_FRAMES_CODE }, { ScoreConfigType::ShowUnprintableElements, SHOW_UNPRINTABLE_CODE },
{ ScoreConfigType::ShowPageMargins, SHOW_PAGEBORDERS_CODE }, { ScoreConfigType::ShowFrames, SHOW_FRAMES_CODE },
{ ScoreConfigType::MarkIrregularMeasures, SHOW_IRREGULAR_CODE } { ScoreConfigType::ShowPageMargins, SHOW_PAGEBORDERS_CODE },
}; { ScoreConfigType::MarkIrregularMeasures, SHOW_IRREGULAR_CODE }
};
m_actionCheckedChanged.send({ configActions.at(configType) });
});
m_actionCheckedChanged.send({ configActions.at(configType) });
});
}
m_controller->currentNotationStyleChanged().onNotify(this, [this]() { m_controller->currentNotationStyleChanged().onNotify(this, [this]() {
m_actionCheckedChanged.send({ TOGGLE_CONCERT_PITCH_CODE }); m_actionCheckedChanged.send({ TOGGLE_CONCERT_PITCH_CODE });
}); });