diff --git a/lib/mapObjects/CObjectClassesHandler.cpp b/lib/mapObjects/CObjectClassesHandler.cpp index 4141edfca..2fbf0a22b 100644 --- a/lib/mapObjects/CObjectClassesHandler.cpp +++ b/lib/mapObjects/CObjectClassesHandler.cpp @@ -94,6 +94,12 @@ CObjectClassesHandler::CObjectClassesHandler() #undef SET_HANDLER } +CObjectClassesHandler::~CObjectClassesHandler() +{ + for(auto p : objects) + delete p.second; +} + std::vector CObjectClassesHandler::loadLegacyData(size_t dataSize) { CLegacyConfigParser parser("Data/Objects.txt"); diff --git a/lib/mapObjects/CObjectClassesHandler.h b/lib/mapObjects/CObjectClassesHandler.h index 2aed19be8..c7aa25375 100644 --- a/lib/mapObjects/CObjectClassesHandler.h +++ b/lib/mapObjects/CObjectClassesHandler.h @@ -211,6 +211,7 @@ class DLL_LINKAGE CObjectClassesHandler : public IHandlerBase ObjectContainter * loadFromJson(const JsonNode & json, const std::string & name); public: CObjectClassesHandler(); + ~CObjectClassesHandler(); std::vector loadLegacyData(size_t dataSize) override;