[sim] GUI: Fix game message string lifetime (#8874)

Fixes an issue where game data can't be set.
This commit is contained in:
Gold856
2026-05-07 23:03:28 -04:00
committed by GitHub
parent 62e0bc515c
commit 8832d6a7c2

View File

@@ -1294,8 +1294,9 @@ void FMSSimModel::UpdateHAL() {
HALSIM_SetDriverStationRobotMode(
static_cast<HAL_RobotMode>(m_robotMode.GetValue()));
HALSIM_SetDriverStationMatchTime(m_matchTime.GetValue());
auto str = wpi::util::make_string(m_gameMessage.GetValue());
HALSIM_SetGameDataString(&str);
std::string str = m_gameMessage.GetValue();
auto gameData = wpi::util::make_string(str);
HALSIM_SetGameDataString(&gameData);
HALSIM_SetDriverStationDsAttached(m_dsAttached.GetValue());
}