diff --git a/src/graphics/stkanimatedmesh.cpp b/src/graphics/stkanimatedmesh.cpp index 8a31354c5..d7d0f883b 100644 --- a/src/graphics/stkanimatedmesh.cpp +++ b/src/graphics/stkanimatedmesh.cpp @@ -24,6 +24,11 @@ const core::vector3df& scale) : isMaterialInitialized = false; } +STKAnimatedMesh::~STKAnimatedMesh() +{ + cleanGLMeshes(); +} + void STKAnimatedMesh::cleanGLMeshes() { for (u32 i = 0; i < GLmeshes.size(); ++i) diff --git a/src/graphics/stkanimatedmesh.hpp b/src/graphics/stkanimatedmesh.hpp index aaa669c28..0a401fb82 100644 --- a/src/graphics/stkanimatedmesh.hpp +++ b/src/graphics/stkanimatedmesh.hpp @@ -23,6 +23,7 @@ public: const irr::core::vector3df& position = irr::core::vector3df(0,0,0), const irr::core::vector3df& rotation = irr::core::vector3df(0,0,0), const irr::core::vector3df& scale = irr::core::vector3df(1.0f, 1.0f, 1.0f)); + ~STKAnimatedMesh(); virtual void render(); virtual void setMesh(irr::scene::IAnimatedMesh* mesh);