Commit cf229438 authored by Aloshi's avatar Aloshi

Fixed some crashes.

Corrected "B" vs. "Start" behavior in GuiMetaDataEd (was inverted).
parent bfdec378
......@@ -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.";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment