mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-25 23:55:38 +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();
|
||||
SystemData::deleteSystems();
|
||||
NavigationSounds::getInstance()->deinit();
|
||||
Settings::deinit();
|
||||
|
||||
// Call this ONLY when linking with FreeImage as a static library.
|
||||
#if defined(FREEIMAGE_LIB)
|
||||
|
|
|
@ -72,10 +72,19 @@ Settings* Settings::getInstance()
|
|||
return sInstance;
|
||||
}
|
||||
|
||||
void Settings::deinit()
|
||||
{
|
||||
if (sInstance) {
|
||||
delete sInstance;
|
||||
sInstance = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void Settings::setDefaults()
|
||||
{
|
||||
mBoolMap.clear();
|
||||
mIntMap.clear();
|
||||
mStringMap.clear();
|
||||
|
||||
// All settings are in pairs of default values and current values.
|
||||
// As such, in this function we set these pairs identically.
|
||||
|
|
|
@ -18,6 +18,7 @@ class Settings
|
|||
{
|
||||
public:
|
||||
static Settings* getInstance();
|
||||
static void deinit();
|
||||
|
||||
void loadFile();
|
||||
void saveFile();
|
||||
|
|
Loading…
Reference in a new issue