From 4a60ce1ab9fdb962004c6a959f682ace3db50cbd Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Sun, 28 Jul 2024 13:37:52 +0400 Subject: [PATCH] Call wl_display_disconnect on non-null display only --- src/modules/desktop_capture/desktop_capturer.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/desktop_capture/desktop_capturer.cc b/src/modules/desktop_capture/desktop_capturer.cc index 3e5b7346..4dd0f9de 100644 --- a/src/modules/desktop_capture/desktop_capturer.cc +++ b/src/modules/desktop_capture/desktop_capturer.cc @@ -143,7 +143,8 @@ bool DesktopCapturer::IsRunningUnderWayland() { (void)dlerror(); if (wl_display_connect && wl_display_disconnect) { const auto display = wl_display_connect(nullptr); - wl_display_disconnect(display); + if (display) + wl_display_disconnect(display); dlclose(lib); return display; }