From 52b3d533f55ddac6caa47ce51e8c7c1717005277 Mon Sep 17 00:00:00 2001 From: Marianne Gagnon Date: Sat, 13 Feb 2016 21:18:03 -0500 Subject: [PATCH] Fix memory management issue --- .../dialogs/ghost_replay_info_dialog.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/states_screens/dialogs/ghost_replay_info_dialog.cpp b/src/states_screens/dialogs/ghost_replay_info_dialog.cpp index 40debc30f..8428dcb51 100644 --- a/src/states_screens/dialogs/ghost_replay_info_dialog.cpp +++ b/src/states_screens/dialogs/ghost_replay_info_dialog.cpp @@ -60,16 +60,21 @@ GUIEngine::EventPropagation if(selection == "start") { + bool reverse = m_rd.m_reverse; + std::string track_name = m_rd.m_track_name; + int laps = m_rd.m_laps; + int replay_id = m_replay_id; + ModalDialog::dismiss(); - ReplayPlay::get()->setReplayFile(m_replay_id); + ReplayPlay::get()->setReplayFile(replay_id); race_manager->setRaceGhostKarts(true); race_manager->setNumKarts(race_manager->getNumLocalPlayers()); // Disable accidentally unlocking of a challenge PlayerManager::getCurrentPlayer()->setCurrentChallenge(""); - race_manager->setReverseTrack(m_rd.m_reverse); - race_manager->startSingleRace(m_rd.m_track_name, m_rd.m_laps, false); + race_manager->setReverseTrack(reverse); + race_manager->startSingleRace(track_name, laps, false); return GUIEngine::EVENT_BLOCK; } else if(selection == "remove")