public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/7399: Exception object destructors called pre-maturely.
@ 2002-12-16 16:45 bangerth
  0 siblings, 0 replies; only message in thread
From: bangerth @ 2002-12-16 16:45 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, lclay, nobody

Synopsis: Exception object destructors called pre-maturely.

State-Changed-From-To: open->closed
State-Changed-By: bangerth
State-Changed-When: Mon Dec 16 16:45:09 2002
State-Changed-Why:
    With gcc3.3 I get the result you expect, with 3.2 I get
    memory corruption. However, if you insert a copy constructor
    for your MyException class and let it output something, you'll
    easily see that it is called in the process of throwin
    an exception (at least with 3.2, and probably also with
    2.96), which easily explains what is going on. Upshot:
    don't do that, i.e. when you allocate memory in a class,
    you have to do a deep copy in the copy constructor, or you
    have to do counted pointers.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7399


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-12-17  0:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-16 16:45 c++/7399: Exception object destructors called pre-maturely bangerth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).