Jump to content
  • Advertisement
Sign in to follow this  
bobason456

Annoying Debug error VS6 [BLOCKTYPE_IS_VALIID]

This topic is 4844 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

Annoying Debug error VS6 I have a pointer to an object created with new, in the class destructor I’m getting the following debug error when I hit the delete operator. Debug Assertion Failed! Dbgdel.cpp, line 47: Expression : BLOCKTYPE_IS_VALIID(pHead->nBlockUse)
CAsset_listNode::~CAsset_listNode()
{
	if(Asset_Asset!=NULL)
	{
		delete Asset_Asset;       // << HERE
		Asset_Asset = NULL;    
	}
}

Does any one have some quick tips? Before I post pages of code. Thanks [Edited by - bobason456 on August 15, 2005 3:16:28 AM]

Share this post


Link to post
Share on other sites
Advertisement
Either:
  1. you have deleted an object twice, or
  2. Asset_Asset is not a valid pointer, or
  3. Asset_Asset was not allocated with new, or
  4. you have written data past the end of an allocation and have overwritten the allocator's bookkeeping information.
The problem is not necessarily in the class where the error occurred.

Share this post


Link to post
Share on other sites
Thanks.. I've found the problem, but not solved it. It was a problem with just one of the many classes that was being pointed to by Asset_Asset.. Unfortunately I was using that class to test my asset management code.

Thanks for your help though..

Just out of interest though, incase it is the issue. What is “you have written data past the end of an allocation and have overwritten the allocator's bookkeeping information.”?

Share this post


Link to post
Share on other sites
Memory allocators usually work by keeping a small amount of information at the start (and maybe end) of each block, such as block length and pointer to the previous block. This means when you do delete or free() it knows the range of memory you're giving up, plus it can combine that block with neighbouring blocks if they are also free. Incidentally I highly recommend Valgrind for catching this kind of error. Sadly it's only available for Linux though.

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!