The GC, destructors, exceptions and memory corruption

Vladimir Panteleev vladimir at thecybershadow.net
Fri May 13 02:28:01 PDT 2011


On Fri, 13 May 2011 11:41:04 +0300, Daniel Gibson <metalcaedes at gmail.com>  
wrote:

> Am 13.05.2011 10:33, schrieb Vladimir Panteleev:
>> On Fri, 13 May 2011 11:22:11 +0300, Daniel Gibson
>> <metalcaedes at gmail.com> wrote:
>>
>>> It may be sane to just define that destructors are nothrow and if they
>>> throw anyway to terminate the program.
>>>
>>> What is the current behaviour anyway? ;)
>>
>> D2 throws a FinalizeError (which is an Error, so "not recoverable").
>
> So the program is terminated? In that case you don't really have to
> worry about the state of the GC, right?

I guess, but this requires that the user does not use catch(Object) or  
catch(Throwable).
I don't know if this is acceptable for SafeD, for example.

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


More information about the Digitalmars-d mailing list