From c8f5aa0d8fb1aee6050479dd7f7630fba9c697ff Mon Sep 17 00:00:00 2001 From: bitplane Date: Thu, 6 Sep 2007 12:38:06 +0000 Subject: [PATCH] fixed memory leak git-svn-id: http://svn.code.sf.net/p/irrlicht/code/trunk@912 dfc29bdd-3216-0410-991c-e03cc46cb475 --- source/Irrlicht/CXMeshFileLoader.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source/Irrlicht/CXMeshFileLoader.cpp b/source/Irrlicht/CXMeshFileLoader.cpp index 9558ded4..364bfa42 100644 --- a/source/Irrlicht/CXMeshFileLoader.cpp +++ b/source/Irrlicht/CXMeshFileLoader.cpp @@ -31,7 +31,7 @@ CXMeshFileLoader::CXMeshFileLoader(scene::ISceneManager* smgr) //! destructor CXMeshFileLoader::~CXMeshFileLoader() { - TemplateMaterials.clear(); + } @@ -75,7 +75,6 @@ IAnimatedMesh* CXMeshFileLoader::createMesh(irr::io::IReadFile* f) MinorVersion=0; binary=0; binaryNumCount=0; - Buffer=0; Size=0; FloatSize=0; P=0; @@ -84,6 +83,12 @@ IAnimatedMesh* CXMeshFileLoader::createMesh(irr::io::IReadFile* f) CurFrame=0; TemplateMaterials.clear(); + if (Buffer) + delete Buffer; + Buffer = 0; + + for (u32 i=0; i