This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: c++/7399: Exception object destructors called pre-maturely.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]