mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-25 23:55:38 +00:00
Fixed a tiny memory leak.
Also fixed a Clang static analyzer error for SystemData.
This commit is contained in:
parent
930bdce576
commit
0beb40d9c9
|
@ -513,7 +513,7 @@ SystemData* SystemData::getRandomSystem(const SystemData* currentSystem)
|
||||||
if (total < 2)
|
if (total < 2)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
SystemData* randomSystem;
|
SystemData* randomSystem = nullptr;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
// Get a random number in range.
|
// Get a random number in range.
|
||||||
|
|
|
@ -511,18 +511,18 @@ int main(int argc, char* argv[])
|
||||||
window.pushGui(new GuiMsgBox(&window, helpStyle,
|
window.pushGui(new GuiMsgBox(&window, helpStyle,
|
||||||
errorMsg.c_str(),
|
errorMsg.c_str(),
|
||||||
"QUIT", [] {
|
"QUIT", [] {
|
||||||
SDL_Event* quit = new SDL_Event();
|
SDL_Event quit;
|
||||||
quit->type = SDL_QUIT;
|
quit.type = SDL_QUIT;
|
||||||
SDL_PushEvent(quit);
|
SDL_PushEvent(&quit);
|
||||||
}, "", nullptr, "", nullptr, true));
|
}, "", nullptr, "", nullptr, true));
|
||||||
}
|
}
|
||||||
else if (returnCodeValue == NO_ROMS) {
|
else if (returnCodeValue == NO_ROMS) {
|
||||||
auto updateVal = [](const std::string& newROMDirectory) {
|
auto updateVal = [](const std::string& newROMDirectory) {
|
||||||
Settings::getInstance()->setString("ROMDirectory", newROMDirectory);
|
Settings::getInstance()->setString("ROMDirectory", newROMDirectory);
|
||||||
Settings::getInstance()->saveFile();
|
Settings::getInstance()->saveFile();
|
||||||
SDL_Event* quit = new SDL_Event();
|
SDL_Event quit;
|
||||||
quit->type = SDL_QUIT;
|
quit.type = SDL_QUIT;
|
||||||
SDL_PushEvent(quit);
|
SDL_PushEvent(&quit);
|
||||||
};
|
};
|
||||||
|
|
||||||
window.pushGui(new GuiMsgBox(&window, helpStyle, errorMsg.c_str(),
|
window.pushGui(new GuiMsgBox(&window, helpStyle, errorMsg.c_str(),
|
||||||
|
@ -553,9 +553,9 @@ int main(int argc, char* argv[])
|
||||||
true));
|
true));
|
||||||
},
|
},
|
||||||
"QUIT", [] {
|
"QUIT", [] {
|
||||||
SDL_Event* quit = new SDL_Event();
|
SDL_Event quit;
|
||||||
quit->type = SDL_QUIT;
|
quit.type = SDL_QUIT;
|
||||||
SDL_PushEvent(quit);
|
SDL_PushEvent(&quit);
|
||||||
}, "", nullptr, true));
|
}, "", nullptr, true));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -289,9 +289,9 @@ bool InputManager::parseEvent(const SDL_Event& ev, Window* window)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (ev.key.keysym.sym == SDLK_F4) {
|
if (ev.key.keysym.sym == SDLK_F4) {
|
||||||
SDL_Event* quit = new SDL_Event();
|
SDL_Event quit;
|
||||||
quit->type = SDL_QUIT;
|
quit.type = SDL_QUIT;
|
||||||
SDL_PushEvent(quit);
|
SDL_PushEvent(&quit);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -224,9 +224,9 @@ int quitES(QuitMode mode)
|
||||||
{
|
{
|
||||||
quitMode = mode;
|
quitMode = mode;
|
||||||
|
|
||||||
SDL_Event *quit = new SDL_Event();
|
SDL_Event quit;
|
||||||
quit->type = SDL_QUIT;
|
quit.type = SDL_QUIT;
|
||||||
SDL_PushEvent(quit);
|
SDL_PushEvent(&quit);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue