mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	Fix crash on closing game with open levelup dialog
This commit is contained in:
		| @@ -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 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user