diff --git a/client/windows/GUIClasses.cpp b/client/windows/GUIClasses.cpp index b3d72c7d0..60b4caef7 100644 --- a/client/windows/GUIClasses.cpp +++ b/client/windows/GUIClasses.cpp @@ -434,14 +434,15 @@ CLevelWindow::CLevelWindow(const CGHeroInstance * hero, PrimarySkill pskill, std skillValue = std::make_shared(192, 253, FONT_MEDIUM, ETextAlignment::CENTER, Colors::WHITE, CGI->generaltexth->primarySkillNames[static_cast(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 & onWindowClosed) diff --git a/client/windows/GUIClasses.h b/client/windows/GUIClasses.h index bd086c25e..bcf8b6794 100644 --- a/client/windows/GUIClasses.h +++ b/client/windows/GUIClasses.h @@ -150,7 +150,8 @@ class CLevelWindow : public CWindowObject public: CLevelWindow(const CGHeroInstance *hero, PrimarySkill pskill, std::vector &skills, std::function callback); - ~CLevelWindow(); + + void close() override; }; /// Town portal, castle gate window