Stack unwinding and destructors?
Date: Mon, 09 Aug 2004 14:07:46 -0400
On page 366 of TC++PL(SE) we are told " The destructor will be called
independently of whether the function is exited normally or exited because
an exception is thrown."
On page 382 the following appears:
"Consider the simple function f() that appears to have nothing to do with
However, g() may throw an exception, so f() must contain code ensuring that
s is destroyed correctly in case of an exception."
These statements seem mutually inconsistent. Would it have been more
correct to use 'string* s = new string();' in place of "string s;"?
Hatton's Law: "There is only One inviolable Law"
KDevelop: http://www.kdevelop.org SuSE: http://www.suse.com
- exit, signals and exceptions
... a signal handler. ... Project.exe faulted with message "application-defined exception". ... void closesockets ... _closesocket's destructor ...
- [patch v2] x86: Add testcases for RODATA and NX protections/attributes
... +config DEBUG_RODATA_TEST ... this implies having dynamic exception handling table entries. ... +static void test_exit ...
- Re: compile error about destructor
... void f2 ... you cares about whether the destructor of local will be ... When there is structured exception thrown, I think even if you do not put ... What do you mean separate the __try block into another function? ...
- Re: Object reference not set to an instance of an object.
... > The event handler WTGDataRowReady10Handler is called by a delegate in the ... > catch (Exception ex) ... > private void WTGDataRowReady10Handler( ...
- [RFC] Improved versioned pointer algorithms
... The orphan test is used in snapshot write and exception delete to ... The current method of determining whether a ghost exception is an ... its child count then the ghost exception is an orphan, ... void set_bit ...