Skip to content

Commit abc6800

Browse files
committed
Fixed memory leak from LoadModelAnimations
1 parent facf34f commit abc6800

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

include/ModelAnimation.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ class ModelAnimation : public ::ModelAnimation {
3939
static std::vector<ModelAnimation> Load(const std::string& fileName) {
4040
int count = 0;
4141
::ModelAnimation* modelAnimations = ::LoadModelAnimations(fileName.c_str(), &count);
42-
return std::vector<ModelAnimation>(modelAnimations, modelAnimations + count);
42+
std::vector<ModelAnimation> mats(modelAnimations, modelAnimations + count);
43+
44+
RL_FREE(modelAnimations);
45+
46+
return mats;
4347
}
4448

4549
GETTERSETTER(int, BoneCount, boneCount)

0 commit comments

Comments
 (0)