commit 7e6cbbc929bb7d52b27d6a717fffe82115dab20b parent 36fbe54eb1302c87033e5581750427c55a68722d Author: dsp56300 <dsp56300@users.noreply.github.com> Date: Tue, 17 May 2022 00:13:53 +0200 fix dangling pointer for non-part-sensitive parameters, use parameter from part 0 instead Diffstat:
M | source/jucePluginLib/controller.cpp | | | 13 | ++++++++----- |
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/source/jucePluginLib/controller.cpp b/source/jucePluginLib/controller.cpp @@ -51,14 +51,17 @@ namespace pluginLib existingParam->addLinkedParameter(p.get()); } - m_paramsByParamType[part].push_back(p.get()); + const bool isNonPartExclusive = desc.isNonPartSensitive(); - const bool isNonPartExclusive = (desc.classFlags & (int)pluginLib::ParameterClass::Global) || (desc.classFlags & (int)pluginLib::ParameterClass::NonPartSensitive); - if (isNonPartExclusive) + if (isNonPartExclusive && part != 0) { - if (part != 0) - continue; // only register on first part! + // only register on first part! + m_paramsByParamType[part].push_back(m_paramsByParamType[0][m_paramsByParamType[part].size()]); + continue; } + + m_paramsByParamType[part].push_back(p.get()); + if (p->getDescription().isPublic) { // lifecycle managed by Juce