mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 22:25:38 +00:00
Fixed some crashes.
Corrected "B" vs. "Start" behavior in GuiMetaDataEd (was inverted).
This commit is contained in:
parent
bfdec378b8
commit
cf2294380a
|
@ -130,6 +130,7 @@ GuiMetaDataEd::GuiMetaDataEd(Window* window, MetaDataList* md, const std::vector
|
|||
std::vector< std::shared_ptr<ButtonComponent> > buttons;
|
||||
buttons.push_back(std::make_shared<ButtonComponent>(mWindow, "SCRAPE", "scrape", std::bind(&GuiMetaDataEd::fetch, this)));
|
||||
buttons.push_back(std::make_shared<ButtonComponent>(mWindow, "SAVE", "save", [&] { save(); delete this; }));
|
||||
buttons.push_back(std::make_shared<ButtonComponent>(mWindow, "CANCEL", "cancel", [&] { delete this; }));
|
||||
|
||||
if(mDeleteFunc)
|
||||
{
|
||||
|
@ -211,7 +212,7 @@ void GuiMetaDataEd::close(bool closeAllWindows)
|
|||
}
|
||||
|
||||
std::function<void()> closeFunc;
|
||||
if(closeAllWindows)
|
||||
if(!closeAllWindows)
|
||||
{
|
||||
closeFunc = [this] { delete this; };
|
||||
}else{
|
||||
|
|
|
@ -90,10 +90,12 @@ void GuiMsgBox::onSizeChanged()
|
|||
|
||||
void GuiMsgBox::deleteMeAndCall(const std::function<void()>& func)
|
||||
{
|
||||
if(func)
|
||||
func();
|
||||
|
||||
auto funcCopy = func;
|
||||
delete this;
|
||||
|
||||
if(funcCopy)
|
||||
funcCopy();
|
||||
|
||||
}
|
||||
|
||||
std::vector<HelpPrompt> GuiMsgBox::getHelpPrompts()
|
||||
|
|
|
@ -273,6 +273,9 @@ int main(int argc, char* argv[])
|
|||
}
|
||||
|
||||
window.deinit();
|
||||
while(window.peekGui() != window.getViewController())
|
||||
delete window.peekGui();
|
||||
|
||||
SystemData::deleteSystems();
|
||||
|
||||
LOG(LogInfo) << "EmulationStation cleanly shutting down.";
|
||||
|
|
Loading…
Reference in a new issue