We have been debugging a strange case for several days and have isolated the error somewhat, but it still makes no sense. Maybe someone here can let me know what is going on.
The problem is an access violation that occurs in a piece of code.
Basically we have something like this:
void aclass::somefunc() {
try {
erroneous_member_function(*someptr);
}
catch (AnException) {
}
}
void aclass::erroneous_member_function(const SomeObject& ref) {
LargeObject obj = Singleton()->Object.someLargeObj;
throw AnException();
UnreachableClass unreachable;
DummyDestruct dummy2;
}
While in the debugger, it seems to destroy the UnreachableClass, and when I insert the DummyDestruct object, it does not crash until the strange destructor is called. So it doesn't seem like the destruction of the LargeObject is going wrong.
All this is in the middle of the production code, and it is very difficult to single out a small example.
: - , , ? , ( Embarcadero RAD), , .
- , ?
Update:
DummyDestruct throw . ( ).