1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Fixed memory leak in CObjectClassesHandler

This commit is contained in:
AlexVinS 2016-08-17 09:24:01 +03:00
parent e7f2858d33
commit e26384062f
2 changed files with 7 additions and 0 deletions

View File

@ -94,6 +94,12 @@ CObjectClassesHandler::CObjectClassesHandler()
#undef SET_HANDLER
}
CObjectClassesHandler::~CObjectClassesHandler()
{
for(auto p : objects)
delete p.second;
}
std::vector<JsonNode> CObjectClassesHandler::loadLegacyData(size_t dataSize)
{
CLegacyConfigParser parser("Data/Objects.txt");

View File

@ -211,6 +211,7 @@ class DLL_LINKAGE CObjectClassesHandler : public IHandlerBase
ObjectContainter * loadFromJson(const JsonNode & json, const std::string & name);
public:
CObjectClassesHandler();
~CObjectClassesHandler();
std::vector<JsonNode> loadLegacyData(size_t dataSize) override;