mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-28 08:48:48 +02:00
Fix crash on closing game with open levelup dialog
This commit is contained in:
parent
b92f0c5619
commit
6c25552f84
@ -434,14 +434,15 @@ CLevelWindow::CLevelWindow(const CGHeroInstance * hero, PrimarySkill pskill, std
|
||||
skillValue = std::make_shared<CLabel>(192, 253, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, CGI->generaltexth->primarySkillNames[static_cast<int>(pskill)] + " +1");
|
||||
}
|
||||
|
||||
|
||||
CLevelWindow::~CLevelWindow()
|
||||
void CLevelWindow::close()
|
||||
{
|
||||
//FIXME: call callback if there was nothing to select?
|
||||
if (box && box->selectedIndex() != -1)
|
||||
cb(box->selectedIndex());
|
||||
|
||||
LOCPLINT->showingDialog->setFree();
|
||||
|
||||
CWindowObject::close();
|
||||
}
|
||||
|
||||
CTavernWindow::CTavernWindow(const CGObjectInstance * TavernObj, const std::function<void()> & onWindowClosed)
|
||||
|
@ -150,7 +150,8 @@ class CLevelWindow : public CWindowObject
|
||||
|
||||
public:
|
||||
CLevelWindow(const CGHeroInstance *hero, PrimarySkill pskill, std::vector<SecondarySkill> &skills, std::function<void(ui32)> callback);
|
||||
~CLevelWindow();
|
||||
|
||||
void close() override;
|
||||
};
|
||||
|
||||
/// Town portal, castle gate window
|
||||
|
Loading…
Reference in New Issue
Block a user