Jump to content
  • Advertisement
Sign in to follow this  

How To Fix Debug Assertion Error?

This topic is 4450 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 get the "Debug Assertion Failed!" notification when I run my program. When I run the debugger, it doesn't show where in my code the error line is. How, then, can I track down and fix this problem? EDIT:: Its in dbgdel.cpp line 52. Expression: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse)

Share this post


Link to post
Share on other sites
Advertisement
Without knowing more of the context, I can only guess at what the assertion means.

Offhand, I'd say you're trying to free a chunk of memory, but using the wrong delete to do it.

If you alloc with new, dealloc with delete.
If you allow with new[ ], dealloc with delete[ ].

My guess is that this assertion is to check that you used the correct pairing.

Share this post


Link to post
Share on other sites
Ah, thank you. Turns out one of my functions was taking in a pointer to an int, and I was trying to check if the integer itself was 0, but instead, I was checking if the pointer was 0. That caused a chain of problems, including the screw up of a char* array. I was able to fix it though, thanks.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!