Probelm about CException in release mode?

Hi,

My application works fine on debug mode, but not fine on release mode.

The GPF will be happen after CException::Delete() every time.

My class structure is like below. Please help me to solve this problem.

Thank you!

class EXPORT CApiException

{

CApiException (bAutoDelete):CException( bAutoDelete) {}

.....

}

CApiException *pError = Sender(..); <== Sender will return an error if error is happened.

if (pError)

{

pError->ReportError();

pError->Delete(); <== GPF is happened here in release mode.

}

[614 byte] By [Ralph13] at [2007-12-29]
# 1

My application works fine on debug mode, but not fine on release mode.

See this FAQ: Why does program work in debug mode, but fail in release mode?

MariusBancila at 2007-9-5 > top of Msdn Tech,Visual C++,Visual C++ Language...
# 2

It difficult to know the reason, without studying whole code. In debug , compiler takes care of lots of things, like initialization, etc.

You can refer http://www.codeproject.com/debug/survivereleasever.asp this article for better understanding.

PrasadSomwanshi at 2007-9-5 > top of Msdn Tech,Visual C++,Visual C++ Language...