diff --git a/include/helpers.hpp b/include/helpers.hpp index 037b1a94..ec26fde5 100644 --- a/include/helpers.hpp +++ b/include/helpers.hpp @@ -6,7 +6,7 @@ namespace rack { -template +template Model *createModel(std::string author, std::string slug, std::string name, Tags... tags) { struct TModel : Model { Module *createModule() override { @@ -14,7 +14,8 @@ Model *createModel(std::string author, std::string slug, std::string name, Tags. return module; } ModuleWidget *createModuleWidget() override { - TModuleWidget *moduleWidget = new TModuleWidget(createModule()); + TModule *module = new TModule(); + TModuleWidget *moduleWidget = new TModuleWidget(module); moduleWidget->model = this; return moduleWidget; } @@ -107,7 +108,7 @@ TPort *createOutputCentered(Vec pos, Module *module, int outputId) { return port; } -template +template TModuleLightWidget *createLight(Vec pos, Module *module, int firstLightId) { TModuleLightWidget *light = new TModuleLightWidget(); light->box.pos = pos; @@ -116,7 +117,7 @@ TModuleLightWidget *createLight(Vec pos, Module *module, int firstLightId) { return light; } -template +template TModuleLightWidget *createLightCentered(Vec pos, Module *module, int firstLightId) { TModuleLightWidget *light = new TModuleLightWidget(); light->box.pos = pos.minus(light->box.size.div(2)); diff --git a/include/plugin.hpp b/include/plugin.hpp index 8c3ecc8d..f3089d9d 100644 --- a/include/plugin.hpp +++ b/include/plugin.hpp @@ -74,7 +74,8 @@ struct Model { return module; } ModuleWidget *createModuleWidget() override { - TModuleWidget *moduleWidget = new TModuleWidget(createModule()); + TModule *module = new TModule(); + TModuleWidget *moduleWidget = new TModuleWidget(module); moduleWidget->model = this; return moduleWidget; }