stack overflow or memory out with new ... delete
Posted: Tue Jan 12, 2010 8:05 am
I have a throwing exception with the "Trap Vector =Access Error (2)"
and i found where is in my software...but i found nothing special at the first time.
then i simulate the parts of the code and i call it all the time in my main to do the throwing exception.
// code with the throwing exception problem.
Normally with "new" in local variable when the variable
is out of the scope in this case out of the if(1){ .. } the memory is delete without the instruction code "delete". but it seem not true...because after near the 4min 10 sec.
if(1)
{
CZone z;
CZone *t = new CZone( z ); // create clone
if(t->IsFull())
{
t->Flush();
}
}
after that i just add the "delete" instruction and i never see the throwing exception...is it because
the netburner not delete it self the memory allocate for the local variable...
if(1)
{
CZone z;
CZone *t = new CZone( z ); // create clone
if(t->IsFull())
{
t->Flush();
}
delete t;
}
I think the issue is the stack over flow but i'm not sure a 100% do you know something about that problem with the memory allocation with "new" and "delete"
Thanks Yanick.
and i found where is in my software...but i found nothing special at the first time.
then i simulate the parts of the code and i call it all the time in my main to do the throwing exception.
// code with the throwing exception problem.
Normally with "new" in local variable when the variable
is out of the scope in this case out of the if(1){ .. } the memory is delete without the instruction code "delete". but it seem not true...because after near the 4min 10 sec.
if(1)
{
CZone z;
CZone *t = new CZone( z ); // create clone
if(t->IsFull())
{
t->Flush();
}
}
after that i just add the "delete" instruction and i never see the throwing exception...is it because
the netburner not delete it self the memory allocate for the local variable...
if(1)
{
CZone z;
CZone *t = new CZone( z ); // create clone
if(t->IsFull())
{
t->Flush();
}
delete t;
}
I think the issue is the stack over flow but i'm not sure a 100% do you know something about that problem with the memory allocation with "new" and "delete"
Thanks Yanick.