From bec451ee84490d08204f81a0a376d53fd9de179d Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Fri, 3 Feb 2023 10:47:49 +0000 Subject: [PATCH] disconnect from display on finish --- src/hyprpicker.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/hyprpicker.cpp b/src/hyprpicker.cpp index e89513b..55e5f30 100644 --- a/src/hyprpicker.cpp +++ b/src/hyprpicker.cpp @@ -35,8 +35,10 @@ void CHyprpicker::init() { //renderSurface(m_pLastSurface); } - wl_display_disconnect(m_pWLDisplay); - m_pWLDisplay = nullptr; + if (m_pWLDisplay) { + wl_display_disconnect(m_pWLDisplay); + m_pWLDisplay = nullptr; + } } void CHyprpicker::finish(int code) { @@ -46,6 +48,11 @@ void CHyprpicker::finish(int code) { destroyBuffer(&ls->screenBuffer); } + if (m_pWLDisplay) { + wl_display_disconnect(m_pWLDisplay); + m_pWLDisplay = nullptr; + } + exit(code); }