gearmulator

Emulation of classic VA synths of the late 90s/2000s that are based on Motorola 56300 family DSPs
Log | Files | Refs | Submodules | README | LICENSE

commit 5a4c087b0411aaccf5dbbe74c757f0230c731f5e
parent 7d301d10ef613398e5bdcf1eebd8e95432dfe0fa
Author: dsp56300 <dsp56300@users.noreply.github.com>
Date:   Tue, 23 Apr 2024 20:17:37 +0200

fix crash when skin load fails

Diffstat:
Msource/jucePluginEditorLib/pluginEditorState.cpp | 2++
Msource/jucePluginLib/parameterbinding.cpp | 4++++
Msource/jucePluginLib/parameterbinding.h | 1+
3 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/source/jucePluginEditorLib/pluginEditorState.cpp b/source/jucePluginEditorLib/pluginEditorState.cpp @@ -119,6 +119,8 @@ void PluginEditorState::loadSkin(const Skin& _skin) LOG("ERROR: Failed to create editor: " << _err.what()); juce::NativeMessageBox::showMessageBoxAsync(juce::MessageBoxIconType::WarningIcon, m_processor.getProperties().name + " - Skin load failed", _err.what(), nullptr, juce::ModalCallbackFunction::create([](int){})); + + m_parameterBinding.clear(); m_editor.reset(); loadSkin(m_includedSkins[0]); diff --git a/source/jucePluginLib/parameterbinding.cpp b/source/jucePluginLib/parameterbinding.cpp @@ -296,7 +296,11 @@ namespace pluginLib { for (const auto& b : m_bindings) disableBinding(b); + clear(); + } + void ParameterBinding::clear() + { m_bindings.clear(); m_boundParameters.clear(); m_boundComponents.clear(); diff --git a/source/jucePluginLib/parameterbinding.h b/source/jucePluginLib/parameterbinding.h @@ -57,6 +57,7 @@ namespace pluginLib void bind(juce::Button &_control, uint32_t _param, uint8_t _part); void clearBindings(); + void clear(); void setPart(uint8_t _part); void disableBindings();