From ee82efa34eb92667dee33aa8d51d1dd5534522bf Mon Sep 17 00:00:00 2001 From: falkTX Date: Sat, 18 Sep 2021 15:49:45 +0100 Subject: [PATCH] Check for valid x11 display before using it Signed-off-by: falkTX --- source/utils/CarlaPluginUI.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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