From 13d43e9782a8051c33fa5fa015dd1d439d4fef94 Mon Sep 17 00:00:00 2001 From: Clayton Groeneveld Date: Sun, 20 Sep 2020 12:39:35 -0500 Subject: [PATCH] frontend-tools: Free xdisplay on Linux auto scene switcher The xdisplay in the Linux scene switcher was never closed when OBS exits. --- UI/frontend-plugins/frontend-tools/auto-scene-switcher-nix.cpp | 2 +- UI/frontend-plugins/frontend-tools/auto-scene-switcher-osx.mm | 2 ++ UI/frontend-plugins/frontend-tools/auto-scene-switcher-win.cpp | 2 ++ UI/frontend-plugins/frontend-tools/auto-scene-switcher.cpp | 2 ++ UI/frontend-plugins/frontend-tools/auto-scene-switcher.hpp | 1 + 5 files changed, 8 insertions(+), 1 deletion(-) diff --git a/UI/frontend-plugins/frontend-tools/auto-scene-switcher-nix.cpp b/UI/frontend-plugins/frontend-tools/auto-scene-switcher-nix.cpp index 0f9084db2..2aa0120a6 100644 --- a/UI/frontend-plugins/frontend-tools/auto-scene-switcher-nix.cpp +++ b/UI/frontend-plugins/frontend-tools/auto-scene-switcher-nix.cpp @@ -27,7 +27,7 @@ Display *disp() return xdisplay; } -void cleanupDisplay() +void CleanupSceneSwitcher() { if (!xdisplay) return; diff --git a/UI/frontend-plugins/frontend-tools/auto-scene-switcher-osx.mm b/UI/frontend-plugins/frontend-tools/auto-scene-switcher-osx.mm index 92dc8b757..98752404e 100644 --- a/UI/frontend-plugins/frontend-tools/auto-scene-switcher-osx.mm +++ b/UI/frontend-plugins/frontend-tools/auto-scene-switcher-osx.mm @@ -41,3 +41,5 @@ void GetCurrentWindowTitle(string &title) } } } + +void CleanupSceneSwitcher() {} diff --git a/UI/frontend-plugins/frontend-tools/auto-scene-switcher-win.cpp b/UI/frontend-plugins/frontend-tools/auto-scene-switcher-win.cpp index 9d25ab37b..9cc45d0ea 100644 --- a/UI/frontend-plugins/frontend-tools/auto-scene-switcher-win.cpp +++ b/UI/frontend-plugins/frontend-tools/auto-scene-switcher-win.cpp @@ -67,3 +67,5 @@ void GetCurrentWindowTitle(string &title) } GetWindowTitle(window, title); } + +void CleanupSceneSwitcher() {} diff --git a/UI/frontend-plugins/frontend-tools/auto-scene-switcher.cpp b/UI/frontend-plugins/frontend-tools/auto-scene-switcher.cpp index 9d8788827..fd94be712 100644 --- a/UI/frontend-plugins/frontend-tools/auto-scene-switcher.cpp +++ b/UI/frontend-plugins/frontend-tools/auto-scene-switcher.cpp @@ -521,6 +521,8 @@ void SwitcherData::Stop() extern "C" void FreeSceneSwitcher() { + CleanupSceneSwitcher(); + delete switcher; switcher = nullptr; } diff --git a/UI/frontend-plugins/frontend-tools/auto-scene-switcher.hpp b/UI/frontend-plugins/frontend-tools/auto-scene-switcher.hpp index 4a155ac9c..4ab611783 100644 --- a/UI/frontend-plugins/frontend-tools/auto-scene-switcher.hpp +++ b/UI/frontend-plugins/frontend-tools/auto-scene-switcher.hpp @@ -45,3 +45,4 @@ public slots: void GetWindowList(std::vector &windows); void GetCurrentWindowTitle(std::string &title); +void CleanupSceneSwitcher();