mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-13 19:54:17 +02:00
Fixed two memory leaks
This commit is contained in:
@@ -1124,8 +1124,11 @@ CCastleInterface::CCastleInterface(const CGTownInstance * Town, const CGTownInst
|
|||||||
exit->assignedKeys.insert(SDLK_ESCAPE);
|
exit->assignedKeys.insert(SDLK_ESCAPE);
|
||||||
exit->setImageOrder(4, 5, 6, 7);
|
exit->setImageOrder(4, 5, 6, 7);
|
||||||
|
|
||||||
auto split = std::make_shared<CButton>(Point(744, 382), "TSBTNS", CButton::tooltip(CGI->generaltexth->tcommands[3]), [&](){garr->splitClick();});
|
auto split = std::make_shared<CButton>(Point(744, 382), "TSBTNS", CButton::tooltip(CGI->generaltexth->tcommands[3]), [&]()
|
||||||
split->addCallback(std::bind(&HeroSlots::splitClicked, heroes));
|
{
|
||||||
|
garr->splitClick();
|
||||||
|
heroes->splitClicked();
|
||||||
|
});
|
||||||
garr->addSplitBtn(split);
|
garr->addSplitBtn(split);
|
||||||
|
|
||||||
Rect barRect(9, 182, 732, 18);
|
Rect barRect(9, 182, 732, 18);
|
||||||
|
@@ -923,9 +923,11 @@ CExchangeWindow::CExchangeWindow(ObjectInstanceID hero1, ObjectInstanceID hero2,
|
|||||||
statusbar = CGStatusBar::create(std::make_shared<CPicture>(*background, barRect, 5, 578, false));
|
statusbar = CGStatusBar::create(std::make_shared<CPicture>(*background, barRect, 5, 578, false));
|
||||||
|
|
||||||
//garrison interface
|
//garrison interface
|
||||||
|
|
||||||
garr = std::make_shared<CGarrisonInt>(69, 131, 4, Point(418,0), heroInst[0], heroInst[1], true, true);
|
garr = std::make_shared<CGarrisonInt>(69, 131, 4, Point(418,0), heroInst[0], heroInst[1], true, true);
|
||||||
garr->addSplitBtn(std::make_shared<CButton>( Point( 10, 132), "TSBTNS.DEF", CButton::tooltip(CGI->generaltexth->tcommands[3]), std::bind(&CGarrisonInt::splitClick, garr)));
|
auto splitButtonCallback = [&](){ garr->splitClick(); };
|
||||||
garr->addSplitBtn(std::make_shared<CButton>( Point(740, 132), "TSBTNS.DEF", CButton::tooltip(CGI->generaltexth->tcommands[3]), std::bind(&CGarrisonInt::splitClick, garr)));
|
garr->addSplitBtn(std::make_shared<CButton>( Point( 10, 132), "TSBTNS.DEF", CButton::tooltip(CGI->generaltexth->tcommands[3]), splitButtonCallback));
|
||||||
|
garr->addSplitBtn(std::make_shared<CButton>( Point(740, 132), "TSBTNS.DEF", CButton::tooltip(CGI->generaltexth->tcommands[3]), splitButtonCallback));
|
||||||
|
|
||||||
updateWidgets();
|
updateWidgets();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user