mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-04-10 19:15:13 +00:00
Fixed a memory leak in Settings.
This commit is contained in:
parent
b90ab39cb7
commit
924b3ac033
|
@ -616,6 +616,7 @@ int main(int argc, char* argv[])
|
||||||
CollectionSystemsManager::deinit();
|
CollectionSystemsManager::deinit();
|
||||||
SystemData::deleteSystems();
|
SystemData::deleteSystems();
|
||||||
NavigationSounds::getInstance()->deinit();
|
NavigationSounds::getInstance()->deinit();
|
||||||
|
Settings::deinit();
|
||||||
|
|
||||||
// Call this ONLY when linking with FreeImage as a static library.
|
// Call this ONLY when linking with FreeImage as a static library.
|
||||||
#if defined(FREEIMAGE_LIB)
|
#if defined(FREEIMAGE_LIB)
|
||||||
|
|
|
@ -72,10 +72,19 @@ Settings* Settings::getInstance()
|
||||||
return sInstance;
|
return sInstance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Settings::deinit()
|
||||||
|
{
|
||||||
|
if (sInstance) {
|
||||||
|
delete sInstance;
|
||||||
|
sInstance = nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Settings::setDefaults()
|
void Settings::setDefaults()
|
||||||
{
|
{
|
||||||
mBoolMap.clear();
|
mBoolMap.clear();
|
||||||
mIntMap.clear();
|
mIntMap.clear();
|
||||||
|
mStringMap.clear();
|
||||||
|
|
||||||
// All settings are in pairs of default values and current values.
|
// All settings are in pairs of default values and current values.
|
||||||
// As such, in this function we set these pairs identically.
|
// As such, in this function we set these pairs identically.
|
||||||
|
|
|
@ -18,6 +18,7 @@ class Settings
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static Settings* getInstance();
|
static Settings* getInstance();
|
||||||
|
static void deinit();
|
||||||
|
|
||||||
void loadFile();
|
void loadFile();
|
||||||
void saveFile();
|
void saveFile();
|
||||||
|
|
Loading…
Reference in a new issue