The GC, destructors, exceptions and memory corruption

Vladimir Panteleev vladimir at thecybershadow.net
Fri May 13 01:12:18 PDT 2011


On Fri, 13 May 2011 10:57:37 +0300, Alexander <aldem+dmars at nk7.net> wrote:

> On 13.05.2011 06:53, Vladimir Panteleev wrote:
>
>> Thus, my question is: what's the expected behavior of D programs when a  
>> destructor throws?
>
>   I would say, the only expected (and correct, IMHO) behavior should be  
> termination of the program because of unhandled exception.

Yes, but what if it's handled (there's a try/catch block around the  
allocation or fullCollect call that invoked the GC)?

-- 
Best regards,
  Vladimir                            mailto:vladimir at thecybershadow.net


More information about the Digitalmars-d mailing list