My program uses MFC. customers report that they see DrWatson from time to time. after debugging it I found that after catching a CDBException , an unhandled exception is thrown during the proccess of deleting this exception.
This is the relevant code:
TRY
{
m_db.ExecuteSQL( strCmd );
}
CATCH(CDBException, e)
{
PutLog(e->m_strError);
e->Delete(); // the unhandled exception is probably thrown from here
}
END_CATCH
am I doing somthing wrong here does someone saw this problem before
Thanks in advance...

unhandled exception during the process of deleting an exception
chrisuk2006
Michal Malecki
I didn't find a problem with deleting the exception altough it is auto deleting- this din't generate any exception.
Deltoid
AfxTryClean()...
CException::Delete()
input()
input executes the TRY CATCH block I attached before.
I can see that a CDBException was thrown b-coz I have it's msg in my application log file. but instad of deleting the exception and exiting normally the program crashes. combining this with the call stack window information , it looks like the proccess of deleting the exception (that starts in the statment e->Delete) generating an exception I don't catch and crashes the program.
I wanted to know if this is a known bug, if anyone herd or saw somthing like this before.
From what I understand , when using the TRY CATCH Macros instad of Try Catch, there is no need to delete the excetion and it will be auto deleted at the end of the CATCH block, so I thought that Deleting it before can cause some problems but I tired it in a small test program and it seems ok....
Appriciate the help, Kfir
Siddu