Jump to content
  • Advertisement
Sign in to follow this  
PoLiSh_Peta

Run-time Assertion

This topic is 4843 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm getting a "Debug Assertion Failed" error when I run my game. The dialogue box also says: dbgdel.cpp line 52 _BLOCK_TYPE_IS_VALID(pHead->nBlockUse) Basically, I have code using delete to free up memory allocated. In the class's destructor that I allocated, I have just this line (line 52): delete [] &animations; Here's what animations is: cAnimation* animations[NUM_ENEMY_ANIMATIONS]; Any ideas of what the problem is? I put in message box code to help me find exactly where it crashed, and everything runs just fine before that line.

Share this post


Link to post
Share on other sites
Advertisement
Only delete what you new. It doesn't look like you newed the animations variable, so you shouldn't try to delete it.

Share this post


Link to post
Share on other sites
You have to use new to allocate the data. Like this:
cAnimation* animations = new cAnimation[NUM_ENEMY_ANIMATIONS];


Edit: and do what ace said also.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!