[Libreoffice-commits] core.git: external/collada2gltf

Markus Mohrhard markus.mohrhard at collabora.co.uk
Sat Jul 5 19:47:54 PDT 2014


 external/collada2gltf/UnpackedTarball_collada2gltf.mk              |    1 
 external/collada2gltf/patches/collada2gltf.fix-memory-leak.patch.1 |   25 ++++++++++
 2 files changed, 26 insertions(+)

New commits:
commit a6da91bd2d19632cb131a732b76559461eed8ee8
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Sun Jul 6 04:29:40 2014 +0200

    fix memory leak in collada2gltf
    
    Found by Lsan. Saves about 12MB per loaded model.
    
    Change-Id: Idaff5defd5affc3d9becf2a00d1e64f8d1d42e0f

diff --git a/external/collada2gltf/UnpackedTarball_collada2gltf.mk b/external/collada2gltf/UnpackedTarball_collada2gltf.mk
index db4b72f..def81f8 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 0000000..a1fbee8
--- /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;


More information about the Libreoffice-commits mailing list