DPF

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

commit a53248a652eb340154c9d8bbc2c9dfbe28b3b0b2
parent 815aa367310bba54e560fb7116a59fe936a31d9f
Author: falkTX <falktx@falktx.com>
Date:   Sat,  1 May 2021 16:52:13 +0100

Do not crash if puglNewWorld fails

Signed-off-by: falkTX <falktx@falktx.com>

Diffstat:
Mdgl/src/ApplicationPrivateData.cpp | 11+++++++----
1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/dgl/src/ApplicationPrivateData.cpp b/dgl/src/ApplicationPrivateData.cpp @@ -78,11 +78,14 @@ void Application::PrivateData::oneWindowHidden() noexcept void Application::PrivateData::idle(const uint timeoutInMs) { - const double timeoutInSeconds = timeoutInMs != 0 - ? static_cast<double>(timeoutInMs) / 1000.0 - : 0.0; + if (world != nullptr) + { + const double timeoutInSeconds = timeoutInMs != 0 + ? static_cast<double>(timeoutInMs) / 1000.0 + : 0.0; - puglUpdate(world, timeoutInSeconds); + puglUpdate(world, timeoutInSeconds); + } #ifndef DPF_TEST_APPLICATION_CPP for (std::list<Window*>::iterator it = windows.begin(), ite = windows.end(); it != ite; ++it)