From aafff1deb63e901d0037220132635e875774900a Mon Sep 17 00:00:00 2001 From: scrawl Date: Fri, 16 Dec 2016 20:40:15 +0100 Subject: [PATCH] Fix memory leak --- components/nifosg/nifloader.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/nifosg/nifloader.cpp b/components/nifosg/nifloader.cpp index d4dabd2f9..a0001d6fd 100644 --- a/components/nifosg/nifloader.cpp +++ b/components/nifosg/nifloader.cpp @@ -1159,10 +1159,11 @@ namespace NifOsg morphGeom->setUpdateCallback(NULL); morphGeom->setCullCallback(new UpdateMorphGeometry); morphGeom->setUseVertexBufferObjects(true); - morphGeom->getOrCreateVertexBufferObject()->setUsage(GL_DYNAMIC_DRAW_ARB); triShapeToGeometry(triShape, morphGeom, parentNode, composite, boundTextures, animflags); + morphGeom->getOrCreateVertexBufferObject()->setUsage(GL_DYNAMIC_DRAW_ARB); + const std::vector& morphs = morpher->data.getPtr()->mMorphs; if (morphs.empty()) return morphGeom;