1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

- proper destructors for handlers and lib objects

This commit is contained in:
Ivan Savenko
2013-04-21 16:38:31 +00:00
parent 2ea1051395
commit 4db13ba845
13 changed files with 79 additions and 10 deletions

View File

@@ -73,11 +73,11 @@ CTown::CTown()
CTown::~CTown()
{
BOOST_FOREACH(auto build, buildings)
BOOST_FOREACH(auto & build, buildings)
build.second.dellNull();
BOOST_FOREACH(CStructure * str, clientInfo.structures)
delete str;
BOOST_FOREACH(auto & str, clientInfo.structures)
str.dellNull();
}
CTownHandler::CTownHandler()
@@ -85,6 +85,12 @@ CTownHandler::CTownHandler()
VLC->townh = this;
}
CTownHandler::~CTownHandler()
{
BOOST_FOREACH(auto faction, factions)
faction.dellNull();
}
JsonNode readBuilding(CLegacyConfigParser & parser)
{
JsonNode ret;