Re: Handle C++ exception and structured exception together
* Pavel:
anon wrote:
George2 wrote:
Hello everyone,
I am learning set_se_translator, and there are some good resources
about how to translate structured exception into C++ exception, like,
http://www.codeproject.com/KB/cpp/seexception.aspx
LOL
this code looks like coming from a clown:
catch(CSeException *e)
{
e->ReportError(MB_OK | MB_ICONSTOP);
e->Delete();
}
Wondering what they do in Delete() method. Hope not "delete this"
I thought "delete this" was not bad-bad, although certainly not ideal.
Sometimes there is no good alternative to at least indirect "delete
this" or its equivalent ... or I simply do not know one. Do you?
The problem is mostly that with an exception there's no designated
"owner" that's responsible for deleting. And with a catch(...) you have
a memory leak. The code above is based on MFC exceptions, which were a
pre-standard hack to use exceptions in a language implementation that
didn't support exceptions.
Cheers, & hth.,
- Alf
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?