From 3191c73e161e33fccbacc0de8d0e707499f469f9 Mon Sep 17 00:00:00 2001 From: pkv Date: Fri, 12 Aug 2022 16:08:28 +0200 Subject: [PATCH] UI: Fix theme leak This fixes leaks when loading and switching themes. Signed-off-by: pkv --- UI/obs-app.cpp | 4 ++-- UI/obs-app.hpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/UI/obs-app.cpp b/UI/obs-app.cpp index 1e13b6748..90b8d71bd 100644 --- a/UI/obs-app.cpp +++ b/UI/obs-app.cpp @@ -1205,8 +1205,8 @@ bool OBSApp::SetTheme(std::string name, std::string path) path = GetTheme(name, path); if (path.empty()) return false; - - themeMeta = ParseThemeMeta(path.c_str()); + unique_ptr themeMeta; + themeMeta.reset(ParseThemeMeta(path.c_str())); string parentPath; if (themeMeta && !themeMeta->parent.empty()) { diff --git a/UI/obs-app.hpp b/UI/obs-app.hpp index df75bec92..c58771806 100644 --- a/UI/obs-app.hpp +++ b/UI/obs-app.hpp @@ -80,7 +80,7 @@ class OBSApp : public QApplication { private: std::string locale; std::string theme; - OBSThemeMeta *themeMeta = nullptr; + bool themeDarkMode = true; ConfigFile globalConfig; TextLookup textLookup;