Browse Source

Fix carla-plugin never deleting plugins

Signed-off-by: falkTX <falktx@falktx.com>
tags/v2.2.0-RC1
falkTX 4 years ago
parent
commit
d82ae66928
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
1 changed files with 12 additions and 0 deletions
  1. +12
    -0
      source/backend/engine/CarlaEngineNative.cpp

+ 12
- 0
source/backend/engine/CarlaEngineNative.cpp View File

@@ -185,6 +185,7 @@ public:
fUiServer(this), fUiServer(this),
fLastScaleFactor(1.0f), fLastScaleFactor(1.0f),
fLastProjectFolder(), fLastProjectFolder(),
fPluginDeleterMutex(),
fOptionsForced(false) fOptionsForced(false)
{ {
carla_debug("CarlaEngineNative::CarlaEngineNative()"); carla_debug("CarlaEngineNative::CarlaEngineNative()");
@@ -1379,6 +1380,11 @@ protected:
static_cast<int>(kUiHeight * fLastScaleFactor + 0.5f), static_cast<int>(kUiHeight * fLastScaleFactor + 0.5f),
nullptr, 0.0f); nullptr, 0.0f);
} }

{
const CarlaMutexLocker cml(fPluginDeleterMutex);
pData->deletePluginsAsNeeded();
}
} }


void uiSetParameterValue(const uint32_t index, const float value) void uiSetParameterValue(const uint32_t index, const float value)
@@ -1518,6 +1524,11 @@ protected:
removeAllPlugins(); removeAllPlugins();
fIsRunning = true; fIsRunning = true;


{
const CarlaMutexLocker cml(fPluginDeleterMutex);
pData->deletePluginsAsNeeded();
}

// stopped during removeAllPlugins() // stopped during removeAllPlugins()
if (! pData->thread.isThreadRunning()) if (! pData->thread.isThreadRunning())
pData->thread.startThread(); pData->thread.startThread();
@@ -1700,6 +1711,7 @@ private:
float fParameters[kNumInParams+kNumOutParams]; float fParameters[kNumInParams+kNumOutParams];
float fLastScaleFactor; float fLastScaleFactor;
CarlaString fLastProjectFolder; CarlaString fLastProjectFolder;
CarlaMutex fPluginDeleterMutex;


bool fOptionsForced; bool fOptionsForced;




Loading…
Cancel
Save