diff --git a/obs/obs-app.cpp b/obs/obs-app.cpp index 01d1dbbff..fdaa41153 100644 --- a/obs/obs-app.cpp +++ b/obs/obs-app.cpp @@ -592,6 +592,7 @@ bool OBSApp::OBSInit() config_save(globalConfig); } + obs_startup(locale.c_str()); mainWindow = new OBSBasic(); mainWindow->setAttribute(Qt::WA_DeleteOnClose, true); diff --git a/obs/obs-app.hpp b/obs/obs-app.hpp index 4b0cee3c0..f5b64889e 100644 --- a/obs/obs-app.hpp +++ b/obs/obs-app.hpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -59,6 +60,7 @@ private: std::string theme; ConfigFile globalConfig; TextLookup textLookup; + OBSContext obsContext; QPointer mainWindow; bool InitGlobalConfig(); diff --git a/obs/window-basic-main.cpp b/obs/window-basic-main.cpp index 3afccd095..b68003e22 100644 --- a/obs/window-basic-main.cpp +++ b/obs/window-basic-main.cpp @@ -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);