Reload GfRaceManagers on downloadsmenu exit

This is required since _vecAcceptedCarCategoryIds must be reloaded so
that car categories are refreshed when entering the driver selection
menu.
This commit is contained in:
Xavier Del Campo Romero 2024-12-28 15:24:40 +01:00
parent a0c2dcc761
commit 9a21275afc
Signed by: xavi
GPG key ID: 84FF3612A9BF43F2
3 changed files with 9 additions and 0 deletions

View file

@ -62,6 +62,12 @@ void GfRaceManagers::shutdown()
_pSelf = 0;
}
void GfRaceManagers::reload()
{
shutdown();
_pSelf = new GfRaceManagers;
}
GfRaceManagers::~GfRaceManagers()
{
std::vector<GfRaceManager*>::const_iterator itRaceMan;

View file

@ -112,6 +112,7 @@ public:
// Accessor to the unique instance of the singleton.
static GfRaceManagers* self();
static void shutdown();
static void reload();
const std::vector<std::string>& getTypes() const;

View file

@ -13,6 +13,7 @@
#include <portability.h>
#include <cars.h>
#include <tracks.h>
#include <racemanagers.h>
#include <drivers.h>
#include "assets.h"
#include "downloadsmenu.h"
@ -1050,6 +1051,7 @@ DownloadsMenu::~DownloadsMenu()
curl_multi_cleanup(multi);
GfCars::reload();
GfTracks::reload();
GfRaceManagers::reload();
GfDrivers::self()->reload();
GfuiScreenRelease(hscr);
GfuiScreenActivate(prev);