1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-26 22:57:00 +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 #undef SET_HANDLER
} }
CObjectClassesHandler::~CObjectClassesHandler()
{
for(auto p : objects)
delete p.second;
}
std::vector<JsonNode> CObjectClassesHandler::loadLegacyData(size_t dataSize) std::vector<JsonNode> CObjectClassesHandler::loadLegacyData(size_t dataSize)
{ {
CLegacyConfigParser parser("Data/Objects.txt"); 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); ObjectContainter * loadFromJson(const JsonNode & json, const std::string & name);
public: public:
CObjectClassesHandler(); CObjectClassesHandler();
~CObjectClassesHandler();
std::vector<JsonNode> loadLegacyData(size_t dataSize) override; std::vector<JsonNode> loadLegacyData(size_t dataSize) override;