avoid reading deallocated memory
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user