Преглед изворни кода

UI: Clear scene data before loading new scene data

Clear scene data before loading new scene files or when creating new
scene data from scratch.
jp9000 пре 10 година
родитељ
комит
5fc21edc1f
1 измењених фајлова са 4 додато и 0 уклоњено
  1. 4 0
      obs/window-basic-main.cpp

+ 4 - 0
obs/window-basic-main.cpp

@@ -348,6 +348,8 @@ void OBSBasic::CreateDefaultScene()
 	bool hasDesktopAudio = HasAudioDevices(App()->OutputAudioSource());
 	bool hasInputAudio   = HasAudioDevices(App()->InputAudioSource());
 
+	ClearSceneData();
+
 	obs_scene_t  *scene  = obs_scene_create(Str("Basic.Scene"));
 	obs_source_t *source = obs_scene_get_source(scene);
 
@@ -418,6 +420,8 @@ void OBSBasic::Load(const char *file)
 		return;
 	}
 
+	ClearSceneData();
+
 	obs_data_t       *data       = obs_data_create_from_json(jsonData);
 	obs_data_array_t *sceneOrder = obs_data_get_array(data, "scene_order");
 	obs_data_array_t *sources    = obs_data_get_array(data, "sources");