Jan 17, 2009

What it wrong with this function:

What it wrong with this function:
F1(...){
x = new();
F2();
delete x;
}
If f2 throws an exception, x may not be deallocated so as to a memory leak

No comments:

Post a Comment