I faced some crash at delete()
. I try to wrap delete()
with try-catch and handle it properly but I still have crash instead of fall into catch section.
Here is example example of what I try to do.
int *i = new int();
delete (i);
try {
delete (i);
}catch (...) {
std::cout << "Oops";
}
The questions is "why I can't catch it in such way?" and "how I can properly catch situation like this?".