提交 1722425f 编写于 作者: J jp9000

UI: Move obs startup/shutdown to obs-app.cpp

Now that we aren't dependent upon a window for our context, we can
safely move the obs context creation/destruction to obs-app.cpp, and use
the OBSContext helper class to automatically shut down obs.
上级 04e4ca1d
......@@ -592,6 +592,7 @@ bool OBSApp::OBSInit()
config_save(globalConfig);
}
obs_startup(locale.c_str());
mainWindow = new OBSBasic();
mainWindow->setAttribute(Qt::WA_DeleteOnClose, true);
......
......@@ -20,6 +20,7 @@
#include <QApplication>
#include <QTranslator>
#include <QPointer>
#include <obs.hpp>
#include <util/lexer.h>
#include <util/util.hpp>
#include <string>
......@@ -59,6 +60,7 @@ private:
std::string theme;
ConfigFile globalConfig;
TextLookup textLookup;
OBSContext obsContext;
QPointer<OBSMainWindow> mainWindow;
bool InitGlobalConfig();
......
......@@ -841,8 +841,6 @@ void OBSBasic::OBSInit()
if (ret <= 0)
throw "Failed to get scene collection json file path";
if (!obs_startup(App()->GetLocale()))
throw "Failed to initialize libobs";
if (!InitBasicConfig())
throw "Failed to load basic.ini";
if (!ResetAudio())
......@@ -1114,8 +1112,6 @@ OBSBasic::~OBSBasic()
* expect or want it to. */
QApplication::sendPostedEvents(this);
obs_shutdown();
config_set_int(App()->GlobalConfig(), "General", "LastVersion",
LIBOBS_API_VER);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册