Sunday, January 15, 2006

SEH exception and C++ exception.

SEH exception and C++ exception.

SEH doesn’t mix well with C++ programming because C++ exceptions are implemented internally with SEH and the compiler complains when you try to combine them indiscriminately. The reason for the conflict is that when straight SHE unwinds out of a function, it doesn’t call any of the C++ object destructors for objects created on the stack. Because C++ objects can do all sorts of initialization in their constructors, such as allocating memory for internal data structures, skipping the destructors can lead to memory leaks and other problems.

No comments: