
Memory leak in GameTut#4? (and a correctness about md2 animation)
I saw what the Nehe news said that there was a memory leak in GameTut#4 and had been eliminated;
I''d like take a look at it, but I cannot find in tut or code where the original memory leak is.
Anyone knows that?
I found a tiny problem about the MD2 animation in GameTut#4.
There would be an abnormal "flip" while the model''s repeating "IDLE"(default animation).
In MD2::Animate(),
if replacing "if(currentFrame==-1 || currentFrame>endFrame)" with "if(currentFrame==-1 || nextFrame>endFrame)",
I think it would get rid of the "flip" problem.

I forget the exact variable names but this is the general idea:
There was an allocation of memory in MD2::Load() I believe
And it was being deleted in MD2::~MD2()
However, whenever you allocate an array of memory, you need to delete the whole array.
I hope you get the general idea.
Edited by - Parveen Kaler on July 17, 2001 5:44:52 PM
There was an allocation of memory in MD2::Load() I believe
|
And it was being deleted in MD2::~MD2()
|
However, whenever you allocate an array of memory, you need to delete the whole array.
|
I hope you get the general idea.
Edited by - Parveen Kaler on July 17, 2001 5:44:52 PM
Ok, thanks... And I should really put a banner on Gamedev.net that says "I HAVE FIXED THE
''delete'' problem!"
NARF!
------------------------------
Trent (ShiningKnight)
E-mail me
OpenGL Game Programming Tutorials
''delete'' problem!"

NARF!
------------------------------
Trent (ShiningKnight)
E-mail me
OpenGL Game Programming Tutorials
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement