@@ -75,25 +75,24 @@ namespace scenes {
7575 if (m_next_command.has_value ()) {
7676 return std::visit (
7777 helper::overloaded{
78- [](const Return&) {
79- return UpdateResult{ SceneUpdate::StopUpdating, Scene::Pop{} };
80- },
78+ [](const Return&) { return UpdateResult{ SceneUpdate::StopUpdating, Scene::Pop{} }; },
8179 [this ](const Action& action) {
82- m_next_command = helper::nullopt ;
83-
8480 if (auto * recording_component =
8581 dynamic_cast <custom_ui::RecordingComponent*>(action.widget );
8682 recording_component != nullptr ) {
8783
8884 const auto recording_path = recording_component->metadata ().path ;
8985
86+ // action is a reference to a structure inside m_next_command, so resetting it means, we need to copy everything out of it
87+ m_next_command = helper::nullopt ;
88+
9089 return UpdateResult{
9190 SceneUpdate::StopUpdating,
92- Scene::RawSwitch{" ReplayGame" ,
91+ Scene::RawSwitch{ " ReplayGame" ,
9392 std::make_unique<ReplayGame>(
94- m_service_provider, ui::FullScreenLayout{ m_service_provider->window () },
93+ m_service_provider, ui::FullScreenLayout{ m_service_provider->window () },
9594 recording_path
96- ) }
95+ ) }
9796 };
9897 }
9998#if defined(_HAVE_FILE_DIALOGS)
@@ -108,6 +107,9 @@ namespace scenes {
108107
109108 add_all_recordings ();
110109
110+ // action is a reference to a structure inside m_next_command, so resetting it means, we need to copy everything out of it
111+ m_next_command = helper::nullopt ;
112+
111113 return UpdateResult{ SceneUpdate::StopUpdating, helper::nullopt };
112114 }
113115
0 commit comments