Fixed some crashes.

Corrected "B" vs. "Start" behavior in GuiMetaDataEd (was inverted).
This commit is contained in:
Aloshi 2014-05-16 17:19:25 -05:00
parent bfdec378b8
commit cf2294380a
3 changed files with 10 additions and 4 deletions

View file

@ -130,6 +130,7 @@ GuiMetaDataEd::GuiMetaDataEd(Window* window, MetaDataList* md, const std::vector
std::vector< std::shared_ptr<ButtonComponent> > buttons; 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, "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, "SAVE", "save", [&] { save(); delete this; }));
buttons.push_back(std::make_shared<ButtonComponent>(mWindow, "CANCEL", "cancel", [&] { delete this; }));
if(mDeleteFunc) if(mDeleteFunc)
{ {
@ -211,7 +212,7 @@ void GuiMetaDataEd::close(bool closeAllWindows)
} }
std::function<void()> closeFunc; std::function<void()> closeFunc;
if(closeAllWindows) if(!closeAllWindows)
{ {
closeFunc = [this] { delete this; }; closeFunc = [this] { delete this; };
}else{ }else{

View file

@ -90,10 +90,12 @@ void GuiMsgBox::onSizeChanged()
void GuiMsgBox::deleteMeAndCall(const std::function<void()>& func) void GuiMsgBox::deleteMeAndCall(const std::function<void()>& func)
{ {
if(func) auto funcCopy = func;
func();
delete this; delete this;
if(funcCopy)
funcCopy();
} }
std::vector<HelpPrompt> GuiMsgBox::getHelpPrompts() std::vector<HelpPrompt> GuiMsgBox::getHelpPrompts()

View file

@ -273,6 +273,9 @@ int main(int argc, char* argv[])
} }
window.deinit(); window.deinit();
while(window.peekGui() != window.getViewController())
delete window.peekGui();
SystemData::deleteSystems(); SystemData::deleteSystems();
LOG(LogInfo) << "EmulationStation cleanly shutting down."; LOG(LogInfo) << "EmulationStation cleanly shutting down.";