@@ -31,6 +31,8 @@ | |||||
# include "ImGuiWidget.hpp" | # include "ImGuiWidget.hpp" | ||||
# include "extra/ScopedPointer.hpp" | # include "extra/ScopedPointer.hpp" | ||||
# include "extra/Thread.hpp" | # include "extra/Thread.hpp" | ||||
#else | |||||
# include "extra/Mutex.hpp" | |||||
#endif | #endif | ||||
#include "CarlaNativePlugin.h" | #include "CarlaNativePlugin.h" | ||||
@@ -674,15 +676,15 @@ struct IldaeilWidget : ImGuiWidget, IdleCallback, Thread { | |||||
{ | { | ||||
if (module->fCarlaHostHandle != nullptr) | if (module->fCarlaHostHandle != nullptr) | ||||
{ | { | ||||
module->fUI = nullptr; | |||||
if (idleCallbackActive) | |||||
module->pcontext->removeIdleCallback(this); | |||||
if (fPluginRunning) | if (fPluginRunning) | ||||
carla_show_custom_ui(module->fCarlaHostHandle, 0, false); | carla_show_custom_ui(module->fCarlaHostHandle, 0, false); | ||||
carla_set_engine_option(module->fCarlaHostHandle, ENGINE_OPTION_FRONTEND_WIN_ID, 0, "0"); | carla_set_engine_option(module->fCarlaHostHandle, ENGINE_OPTION_FRONTEND_WIN_ID, 0, "0"); | ||||
if (idleCallbackActive) | |||||
module->pcontext->removeIdleCallback(this); | |||||
module->fUI = nullptr; | |||||
} | } | ||||
if (isThreadRunning()) | if (isThreadRunning()) | ||||
@@ -121,6 +121,7 @@ RACK_FILES += $(filter-out $(IGNORED_FILES), $(wildcard Rack/src/*/*.cpp)) | |||||
# -------------------------------------------------------------- | # -------------------------------------------------------------- | ||||
# lots of warnings from VCV side | # lots of warnings from VCV side | ||||
BASE_FLAGS += -Wno-unknown-warning-option | |||||
BASE_FLAGS += -Wno-unused-but-set-variable | BASE_FLAGS += -Wno-unused-but-set-variable | ||||
BASE_FLAGS += -Wno-unused-parameter | BASE_FLAGS += -Wno-unused-parameter | ||||
BASE_FLAGS += -Wno-unused-result | BASE_FLAGS += -Wno-unused-result | ||||
@@ -41,6 +41,7 @@ | |||||
#include <random.hpp> | #include <random.hpp> | ||||
#include <patch.hpp> | #include <patch.hpp> | ||||
#include <plugin.hpp> | #include <plugin.hpp> | ||||
#include <helpers.hpp> | |||||
#ifdef NDEBUG | #ifdef NDEBUG | ||||
# undef DEBUG | # undef DEBUG | ||||
@@ -585,6 +586,9 @@ void Engine::removeModule_NoLock(Module* module) { | |||||
m->rightExpander.module = NULL; | m->rightExpander.module = NULL; | ||||
} | } | ||||
} | } | ||||
// Remove from widgets cache | |||||
if (auto* const helper = reinterpret_cast<CardinalPluginModelHelper*>(module->model)) | |||||
helper->clearCachedModuleWidget(module); | |||||
// Remove module | // Remove module | ||||
internal->modulesCache.erase(module->id); | internal->modulesCache.erase(module->id); | ||||
internal->modules.erase(it); | internal->modules.erase(it); | ||||
@@ -981,8 +985,14 @@ void Engine::fromJson(json_t* rootJ) { | |||||
} | } | ||||
// Create module | // Create module | ||||
Module* module = model->createModule(); | |||||
DISTRHO_SAFE_ASSERT_RETURN(module,); | |||||
Module* const module = model->createModule(); | |||||
DISTRHO_SAFE_ASSERT_CONTINUE(module != nullptr); | |||||
// Create the widget too, needed by a few modules | |||||
auto* const helper = reinterpret_cast<CardinalPluginModelHelper*>(model); | |||||
DISTRHO_SAFE_ASSERT_CONTINUE(helper != nullptr); | |||||
helper->createCachedModuleWidget(module); | |||||
try { | try { | ||||
// This doesn't need a lock because the Module is not added to the Engine yet. | // This doesn't need a lock because the Module is not added to the Engine yet. | ||||