diff options
author | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-07-06 04:29:40 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-07-06 04:43:18 +0200 |
commit | a6da91bd2d19632cb131a732b76559461eed8ee8 (patch) | |
tree | 38d651e237aa3d73cfc3f894c6ce64159c08c939 /external | |
parent | 6f855fed653d6cdbfb30f8cd579d5d8d7f108aba (diff) |
fix memory leak in collada2gltf
Found by Lsan. Saves about 12MB per loaded model.
Change-Id: Idaff5defd5affc3d9becf2a00d1e64f8d1d42e0f
Diffstat (limited to 'external')
-rw-r--r-- | external/collada2gltf/UnpackedTarball_collada2gltf.mk | 1 | ||||
-rw-r--r-- | external/collada2gltf/patches/collada2gltf.fix-memory-leak.patch.1 | 25 |
2 files changed, 26 insertions, 0 deletions
diff --git a/external/collada2gltf/UnpackedTarball_collada2gltf.mk b/external/collada2gltf/UnpackedTarball_collada2gltf.mk index db4b72ff69e7..def81f89f69d 100644 --- a/external/collada2gltf/UnpackedTarball_collada2gltf.mk +++ b/external/collada2gltf/UnpackedTarball_collada2gltf.mk @@ -16,6 +16,7 @@ $(eval $(call gb_UnpackedTarball_add_file,collada2gltf,.,external/collada2gltf/G $(eval $(call gb_UnpackedTarball_add_patches,collada2gltf,\ external/collada2gltf/patches/wrong_uri_usage.patch.1 \ external/collada2gltf/patches/collada2gltf.new-delete-mismatch.patch.1 \ + external/collada2gltf/patches/collada2gltf.fix-memory-leak.patch.1 \ )) # vim: set noet sw=4 ts=4: diff --git a/external/collada2gltf/patches/collada2gltf.fix-memory-leak.patch.1 b/external/collada2gltf/patches/collada2gltf.fix-memory-leak.patch.1 new file mode 100644 index 000000000000..a1fbee874263 --- /dev/null +++ b/external/collada2gltf/patches/collada2gltf.fix-memory-leak.patch.1 @@ -0,0 +1,25 @@ +diff -ur collada2gltf.org/shaders/commonProfileShaders.cpp collada2gltf/shaders/commonProfileShaders.cpp +--- collada2gltf.org/shaders/commonProfileShaders.cpp 2014-07-06 04:20:31.152197885 +0200 ++++ collada2gltf/shaders/commonProfileShaders.cpp 2014-07-06 04:27:21.681181083 +0200 +@@ -495,6 +495,10 @@ + this->_profile = profile; + this->_instanceProgram = new GLSLProgram(profile); + } ++ ++ ~Pass() { ++ delete _instanceProgram; ++ } + + GLSLProgram* instanceProgram() { + return this->_instanceProgram; +@@ -1188,6 +1192,10 @@ + fragmentShader->appendCode("}\n"); + + } ++ ++ ~Technique() { ++ delete _pass; ++ } + + shared_ptr <GLTF::JSONObject> parameters() { + return _parameters; |