summaryrefslogtreecommitdiff
path: root/external/collada2gltf/patches/collada2gltf.fix-memory-leak2.patch.1
blob: 81b4db86f016dee95c140bf681ccbb1213fb2477 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff -ur collada2gltf.org/COLLADA2GLTFWriter.cpp collada2gltf/COLLADA2GLTFWriter.cpp
--- collada2gltf.org/COLLADA2GLTFWriter.cpp	2014-07-06 06:42:01.305850400 +0200
+++ collada2gltf/COLLADA2GLTFWriter.cpp	2014-07-06 06:45:57.000840753 +0200
@@ -75,10 +75,13 @@
                 
 		COLLADAFW::Root root(&this->_loader, this);
         this->_loader.registerExtraDataCallbackHandler(this->_extraDataHandler);
-		if (!root.loadDocument(asset->getInputFilePath()))
+		if (!root.loadDocument(asset->getInputFilePath())) {
+                    delete _extraDataHandler;
 			return false;
+                }
         
         asset->write();
+        delete _extraDataHandler;
                 
 		return true;
 	}