Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

a non understandable debug error

Status
Not open for further replies.

jayjay60

Programmer
Jun 19, 2001
97
0
0
FR
In my application i have a debug error message that occurs when i want to delete a pointer.

in the code:

int *pTabBinPort=new int[m_dlgAsset];
.
.
.
.
delete []pTabBinPort;


i do that at the end of a function, and when i do debug test when it arrives to this point a message error box arrives and i could read this message:

Debug error!

Program : D:\CalcRiskPort\Debug\CalcRiskPort.exe
DAMAGE : before Normal block(#74) at 0x00301E20

So, is anybody could explain to me what is the problem?

Thanks in advance for your answers

jayjay
 
Hi,
Could you show us what is between the new and delete in your code? There is nothing wrong with the new and delete statements. Also, what was the value of m_dlgAsset when
the debug error occurred?
Steve
 
maybe m_dlgAsset was < 0 when the array was create...
 
No. You would get an invalid allocation size debug error message if the argument was negative. [evil]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top