Skip to content

Commit

Permalink
Fix memory leaks. (#136)
Browse files Browse the repository at this point in the history
Signed-off-by: Hill Ma <hillma@google.com>
  • Loading branch information
mahiuchun authored Dec 7, 2020
1 parent 2b1c928 commit f5eaee6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions graphics/src/Animation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,8 @@ NumericAnimation::NumericAnimation(const std::string &_name,
/////////////////////////////////////////////////
NumericAnimation::~NumericAnimation()
{
for (auto kf : this->keyFrames)
delete kf;
}

/////////////////////////////////////////////////
Expand Down
5 changes: 4 additions & 1 deletion graphics/src/Skeleton.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ Skeleton::Skeleton(SkeletonNode *_root)
//////////////////////////////////////////////////
Skeleton::~Skeleton()
{
delete this->data->root;
for (auto& kv : this->data->nodes)
delete kv.second;
for (auto& a : this->data->anims)
delete a;
delete this->data;
this->data = NULL;
}
Expand Down

0 comments on commit f5eaee6

Please sign in to comment.