UI: Fix context bar shutdown crash

This commit is contained in:
gxalpha 2021-11-20 02:58:24 +01:00 committed by Jim
parent e6dc6c2d94
commit 3ccc963e53

View File

@ -54,8 +54,10 @@ void SourceToolbar::SetUndoProperties(obs_source_t *source, bool repeatable)
OBSBasic *main = reinterpret_cast<OBSBasic *>(App()->GetMainWindow());
std::string scene_name =
obs_source_get_name(main->GetCurrentSceneSource());
OBSSource currentSceneSource = main->GetCurrentSceneSource();
if (!currentSceneSource)
return;
std::string scene_name = obs_source_get_name(currentSceneSource);
auto undo_redo = [scene_name,
main = std::move(main)](const std::string &data) {
obs_data_t *settings = obs_data_create_from_json(data.c_str());