UI: Always retain collection data of unloaded modules
This commit is contained in:
parent
5e1909d54f
commit
31aa700d22
2 changed files with 10 additions and 19 deletions
|
|
@ -833,18 +833,11 @@ void OBSBasic::Save(const char *file)
|
|||
}
|
||||
|
||||
if (api) {
|
||||
if (safeModeModuleData) {
|
||||
/* If we're in Safe Mode and have retained unloaded
|
||||
* plugin data, update the existing data object instead
|
||||
* of creating a new one. */
|
||||
api->on_save(safeModeModuleData);
|
||||
obs_data_set_obj(saveData, "modules",
|
||||
safeModeModuleData);
|
||||
} else {
|
||||
OBSDataAutoRelease moduleObj = obs_data_create();
|
||||
api->on_save(moduleObj);
|
||||
obs_data_set_obj(saveData, "modules", moduleObj);
|
||||
}
|
||||
if (!collectionModuleData)
|
||||
collectionModuleData = obs_data_create();
|
||||
|
||||
api->on_save(collectionModuleData);
|
||||
obs_data_set_obj(saveData, "modules", collectionModuleData);
|
||||
}
|
||||
|
||||
if (lastOutputResolution) {
|
||||
|
|
@ -1133,11 +1126,9 @@ void OBSBasic::LoadData(obs_data_t *data, const char *file)
|
|||
if (api)
|
||||
api->on_preload(modulesObj);
|
||||
|
||||
if (safe_mode || disable_3p_plugins) {
|
||||
/* Keep a reference to "modules" data so plugins that are not
|
||||
* loaded do not have their collection specific data lost. */
|
||||
safeModeModuleData = obs_data_get_obj(data, "modules");
|
||||
}
|
||||
/* Keep a reference to "modules" data so plugins that are not loaded do
|
||||
* not have their collection specific data lost. */
|
||||
collectionModuleData = obs_data_get_obj(data, "modules");
|
||||
|
||||
OBSDataArrayAutoRelease sceneOrder =
|
||||
obs_data_get_array(data, "scene_order");
|
||||
|
|
@ -5010,7 +5001,7 @@ void OBSBasic::ClearSceneData()
|
|||
outputHandler->UpdateVirtualCamOutputSource();
|
||||
}
|
||||
|
||||
safeModeModuleData = nullptr;
|
||||
collectionModuleData = nullptr;
|
||||
lastScene = nullptr;
|
||||
swapScene = nullptr;
|
||||
programScene = nullptr;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue