From 4800592726625796662
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,42bdcd88874b6323
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 1993-04-27 19:26:12 PST
Path: gmd.de!ira.uka.de!howland.reston.ans.net!sol.ctr.columbia.edu!caen!batcomputer!munnari.oz.au!sol.deakin.OZ.AU!news.cs.uow.edu.au!picasso.cssc-syd.tansu.com.au!minotaur!gregw
From: gregw@minotaur.tansu.com.au (Greg Wilkins)
Newsgroups: comp.std.c++
Subject: Re: exceptions and destructors
Date: 28 Apr 1993 01:23:08 GMT
Organization: AOTC - CSSC
Lines: 33
Distribution: world
Message-ID: <1rkm9s$jgf@picasso.cssc-syd.tansu.com.au>
References: <pathak-260493130651@virtual.mitre.org>
Reply-To: gregw@minotaur.tansu.com.au
NNTP-Posting-Host: minotaur.cssc-syd.tansu.com.au


Are destructors allowed to throw exceptions?   If so in the code:

    Foo *f= new Foo;
    try
    {
         delete f;
    }
    catch(...)
    {
         ???
    }

What is the state of *f in the handler?
Have the destructors for all sub-objects been called?
What is the best action that the handler can perform? 
Should it be:

    Foo *f= new Foo;
    try
    {
         delete f;
    }
    catch(...)
    {
         void* v = (void*)f;
         delete v;
    }


-gregw




