Solved

DEBUG ERROR!

Posted on 2000-05-04
2
207 Views
Last Modified: 2010-04-02
Dear All,

 A DEBUG Error appears when I call a delete operation in my program, eg

delete video_decoder;

I checked that it had passed all the operations in the destructor however, it can't return to my main program.

In the debug error message, it shows:

DAMAGE: after Normal block (#28) at 0x00A40060.

Do you know the reason and any solution?

Thanks
0
Comment
Question by:littleboy
2 Comments
 

Expert Comment

by:forza
Comment Utility
Can you post some code?
0
 
LVL 3

Accepted Solution

by:
LucHoltkamp earned 100 total points
Comment Utility
I think you overwritten a piece of memory after or before the memory you allocated, somewhere you use an uninitialised pointer, or reference a piece of memory bejond the allocated range.
In DEBUG mode, MFC (if its VC) will allocate a small extra piece of memory before and after a block of memory that is allocated with new.
When the memory is deleted, it checks if you've overwritten that piece of memory, and if so, issues an assertion.
Luc
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now