فهرست منبع

UI: Fix theme leak

This fixes leaks when loading and switching themes.

Signed-off-by: pkv <[email protected]>
pkv 3 سال پیش
والد
کامیت
3191c73e16
2فایلهای تغییر یافته به همراه3 افزوده شده و 3 حذف شده
  1. 2 2
      UI/obs-app.cpp
  2. 1 1
      UI/obs-app.hpp

+ 2 - 2
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<OBSThemeMeta> themeMeta;
+	themeMeta.reset(ParseThemeMeta(path.c_str()));
 	string parentPath;
 
 	if (themeMeta && !themeMeta->parent.empty()) {

+ 1 - 1
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;