UI: Don't std::move main in SetUndoProperties

main is used later in the function, making this undefined behavior.
Though we can move the scene_name string.

Detected by PVS Studio.
This commit is contained in:
Richard Stanway 2023-04-02 19:34:50 +02:00 committed by Rodney
parent 288dfd2660
commit a781f4a887

View file

@ -56,8 +56,8 @@ void SourceToolbar::SetUndoProperties(obs_source_t *source, bool repeatable)
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) {
auto undo_redo = [scene_name = std::move(scene_name),
main](const std::string &data) {
OBSDataAutoRelease settings =
obs_data_create_from_json(data.c_str());
OBSSourceAutoRelease source = obs_get_source_by_name(