diff --git a/source/utils/CarlaPluginUI.cpp b/source/utils/CarlaPluginUI.cpp index 4f925afe7..1f5f2b1f8 100644 --- a/source/utils/CarlaPluginUI.cpp +++ b/source/utils/CarlaPluginUI.cpp @@ -123,6 +123,9 @@ public: { CARLA_SAFE_ASSERT(! fIsVisible); + if (fDisplay == nullptr) + return; + if (fIsVisible) { XUnmapWindow(fDisplay, fHostWindow); @@ -135,11 +138,8 @@ public: fHostWindow = 0; } - if (fDisplay != nullptr) - { - XCloseDisplay(fDisplay); - fDisplay = nullptr; - } + XCloseDisplay(fDisplay); + fDisplay = nullptr; } void show() override