From b0e51ca92b12eea527115f82a21d21cc68ad8705 Mon Sep 17 00:00:00 2001 From: pouillot Date: Sun, 11 Mar 2012 13:03:25 +0000 Subject: [PATCH] Re #591 Fixes crash when abandoning non-Career multi-event races during 1st event git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@4574 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: 308fac76874b811465ea3fad43b3407057a7796a Former-commit-id: adbc6d63c9ea4ff650e9e39a584206aefd13e42f --- src/libs/raceengine/racemain.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/libs/raceengine/racemain.cpp b/src/libs/raceengine/racemain.cpp index dc582e268..49cc43790 100644 --- a/src/libs/raceengine/racemain.cpp +++ b/src/libs/raceengine/racemain.cpp @@ -86,8 +86,20 @@ int ReConfigure() void ReRaceAbandon() { - // Shutdown current event. - ReRaceEventShutdown(); + // Notify the UI that the race event is finishing now. + ReUI().onRaceEventFinishing(); + + // Shutdown track-physics-related stuff. + ReTrackShutdown(); + + // Cleanup needed stuff. + FREEZ(ReInfo->_reCarInfo); + + if (ReInfo->params != ReInfo->mainParams) + { + GfParmReleaseHandle(ReInfo->params); + ReInfo->params = ReInfo->mainParams; + } // Return to race configuration step ReStateApply((void*)RE_STATE_CONFIG);