DPF

DISTRHO Plugin Framework
Log | Files | Refs | Submodules | README | LICENSE

commit 27c173f68f0f3899c92f61f93ff4b6f90fd9ac89
parent 8a702c3672856cdf5085e3a4eff82a1fd7612eb2
Author: falkTX <falktx@falktx.com>
Date:   Mon, 13 Sep 2021 18:05:03 +0100

Allow to call Application::quit() from plugins

Diffstat:
Mdgl/Application.hpp | 1-
Mdgl/src/Application.cpp | 2--
Mdgl/src/ApplicationPrivateData.cpp | 2--
Mdistrho/src/DistrhoPluginVST2.cpp | 5+++++
Mdistrho/src/DistrhoUIInternal.hpp | 4+---
5 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/dgl/Application.hpp b/dgl/Application.hpp @@ -64,7 +64,6 @@ public: Quit the application. This stops the event-loop and closes all Windows. This function is thread-safe. - @note This function is meant for standalones only, *never* call this from plugins. */ void quit(); diff --git a/dgl/src/Application.cpp b/dgl/src/Application.cpp @@ -43,8 +43,6 @@ void Application::exec(const uint idleTimeInMs) void Application::quit() { - DISTRHO_SAFE_ASSERT_RETURN(pData->isStandalone,); - pData->quit(); } diff --git a/dgl/src/ApplicationPrivateData.cpp b/dgl/src/ApplicationPrivateData.cpp @@ -127,8 +127,6 @@ void Application::PrivateData::idle(const uint timeoutInMs) void Application::PrivateData::quit() { - DISTRHO_SAFE_ASSERT_RETURN(isStandalone,); - if (! isThisTheMainThread(mainThreadHandle)) { if (! isQuittingInNextCycle) diff --git a/distrho/src/DistrhoPluginVST2.cpp b/distrho/src/DistrhoPluginVST2.cpp @@ -202,6 +202,11 @@ public: # endif } + ~UIVst() + { + fUI.quit(); + } + // ------------------------------------------------------------------- void idle() diff --git a/distrho/src/DistrhoUIInternal.hpp b/distrho/src/DistrhoUIInternal.hpp @@ -228,9 +228,7 @@ public: void quit() { uiData->window->close(); - - if (uiData->app.isStandalone()) - uiData->app.quit(); + uiData->app.quit(); } // -------------------------------------------------------------------