Kaydet (Commit) 8ea27021 authored tarafından Zolnai Tamás's avatar Zolnai Tamás

libgltf: Stop a memory leak

Change-Id: I7f3f5cfcdc368907670d58b07300889ea8452340
üst 9feb55b6
...@@ -32,6 +32,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,libgltf,\ ...@@ -32,6 +32,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,libgltf,\
external/libgltf/patches/fix_package_file.patch \ external/libgltf/patches/fix_package_file.patch \
external/libgltf/patches/comma_at_end_of_enumerator_list.patch \ external/libgltf/patches/comma_at_end_of_enumerator_list.patch \
external/libgltf/patches/extra_semicolon.patch \ external/libgltf/patches/extra_semicolon.patch \
external/libgltf/patches/stop_a_potential_memory_leak.patch \
)) ))
# vim: set noet sw=4 ts=4: # vim: set noet sw=4 ts=4:
changeset: 1068:ef62f9d46016
branch: improvement
parent: 1065:ce62a560f347
user: LeiQu
date: Tue Jul 01 14:46:15 2014 +0800
summary: Fix the bug of memory leak
diff -ur libgltf.org/src/LoadScene.cpp libgltf/src/LoadScene.cpp
--- libgltf.org/src/LoadScene.cpp 2014-07-04 16:35:53.702409179 +0200
+++ libgltf/src/LoadScene.cpp 2014-07-04 16:35:59.926408911 +0200
@@ -1052,10 +1052,14 @@
std::string nodeId;
for (; it != itEnd; ++it)
{
- Animation* pAnimation = new Animation();
boost::property_tree::ptree pAnimTree = it->second;
nodeId = parseChannel(pAnimTree);
- parsePara(pAnimTree, pAnimation, nodeId);
+ if (nodeId.empty())
+ {
+ continue;
+ }
+ Animation* pAnimation = new Animation();
+ parsePara(pAnimTree, pAnimation, nodeId);
this->pScene->insertAnimMap(nodeId, pAnimation);
}
return true;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment