diff --git a/include/engine/Module.hpp b/include/engine/Module.hpp index df58f3fb..a848ffa6 100644 --- a/include/engine/Module.hpp +++ b/include/engine/Module.hpp @@ -84,6 +84,7 @@ struct Module { template void configParam(int paramId, float minValue, float maxValue, float defaultValue, std::string label = "", std::string unit = "", float displayBase = 0.f, float displayMultiplier = 1.f, float displayOffset = 0.f) { + assert(paramId < (int) params.size() && paramId < (int) paramQuantities.size()); if (paramQuantities[paramId]) delete paramQuantities[paramId]; diff --git a/src/app/Toolbar.cpp b/src/app/Toolbar.cpp index e0379048..f8afd1e6 100644 --- a/src/app/Toolbar.cpp +++ b/src/app/Toolbar.cpp @@ -479,8 +479,6 @@ struct LogInItem : ui::MenuItem { struct ManageItem : ui::MenuItem { - ManageItem() { - } void onAction(const event::Action &e) override { std::thread t([&]() { system::openBrowser("https://vcvrack.com/plugins.html"); diff --git a/src/engine/Module.cpp b/src/engine/Module.cpp index da0f5648..3f51fdd2 100644 --- a/src/engine/Module.cpp +++ b/src/engine/Module.cpp @@ -16,6 +16,8 @@ Module::~Module() { } void Module::config(int numParams, int numInputs, int numOutputs, int numLights) { + // This method should only be called once. + assert(params.empty() && inputs.empty() && outputs.empty() && lights.empty() && paramQuantities.empty()); params.resize(numParams); inputs.resize(numInputs); outputs.resize(numOutputs);