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)
|
||||
return nullptr;
|
||||
|
||||
SystemData* randomSystem;
|
||||
SystemData* randomSystem = nullptr;
|
||||
|
||||
do {
|
||||
// Get a random number in range.
|
||||
|
|
|
@ -511,18 +511,18 @@ int main(int argc, char* argv[])
|
|||
window.pushGui(new GuiMsgBox(&window, helpStyle,
|
||||
errorMsg.c_str(),
|
||||
"QUIT", [] {
|
||||
SDL_Event* quit = new SDL_Event();
|
||||
quit->type = SDL_QUIT;
|
||||
SDL_PushEvent(quit);
|
||||
SDL_Event quit;
|
||||
quit.type = SDL_QUIT;
|
||||
SDL_PushEvent(&quit);
|
||||
}, "", nullptr, "", nullptr, true));
|
||||
}
|
||||
else if (returnCodeValue == NO_ROMS) {
|
||||
auto updateVal = [](const std::string& newROMDirectory) {
|
||||
Settings::getInstance()->setString("ROMDirectory", newROMDirectory);
|
||||
Settings::getInstance()->saveFile();
|
||||
SDL_Event* quit = new SDL_Event();
|
||||
quit->type = SDL_QUIT;
|
||||
SDL_PushEvent(quit);
|
||||
SDL_Event quit;
|
||||
quit.type = SDL_QUIT;
|
||||
SDL_PushEvent(&quit);
|
||||
};
|
||||
|
||||
window.pushGui(new GuiMsgBox(&window, helpStyle, errorMsg.c_str(),
|
||||
|
@ -553,9 +553,9 @@ int main(int argc, char* argv[])
|
|||
true));
|
||||
},
|
||||
"QUIT", [] {
|
||||
SDL_Event* quit = new SDL_Event();
|
||||
quit->type = SDL_QUIT;
|
||||
SDL_PushEvent(quit);
|
||||
SDL_Event quit;
|
||||
quit.type = SDL_QUIT;
|
||||
SDL_PushEvent(&quit);
|
||||
}, "", nullptr, true));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -289,9 +289,9 @@ bool InputManager::parseEvent(const SDL_Event& ev, Window* window)
|
|||
return false;
|
||||
|
||||
if (ev.key.keysym.sym == SDLK_F4) {
|
||||
SDL_Event* quit = new SDL_Event();
|
||||
quit->type = SDL_QUIT;
|
||||
SDL_PushEvent(quit);
|
||||
SDL_Event quit;
|
||||
quit.type = SDL_QUIT;
|
||||
SDL_PushEvent(&quit);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -224,9 +224,9 @@ int quitES(QuitMode mode)
|
|||
{
|
||||
quitMode = mode;
|
||||
|
||||
SDL_Event *quit = new SDL_Event();
|
||||
quit->type = SDL_QUIT;
|
||||
SDL_PushEvent(quit);
|
||||
SDL_Event quit;
|
||||
quit.type = SDL_QUIT;
|
||||
SDL_PushEvent(&quit);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue