avoid reading deallocated memory

This commit is contained in:
konstin
2014-06-21 16:19:37 +02:00
parent 3679bf4617
commit 7e9361bc8b
2 changed files with 2 additions and 2 deletions

View File

@@ -246,6 +246,7 @@ void GPInfoDialog::addButtons()
void GPInfoDialog::onEnterPressedInternal()
{
// Save the GP id because dismiss() will destroy this instance
std::string gp_id = m_gp->getId();
ModalDialog::dismiss();
// Disable accidentally unlocking of a challenge

View File

@@ -138,9 +138,8 @@ GUIEngine::EventPropagation RandomGPInfoDialog::processEvent(
{
if (eventSource == "start")
{
// Save the gp since dismiss deletes it otherwise
ModalDialog::dismiss();
race_manager->startGP(m_gp, false, false);
race_manager->startGP(grand_prix_manager->m_random_gp, false, false);
return GUIEngine::EVENT_BLOCK;
}
else if (eventSource == "Number of tracks")