The "@safe vs struct destructor" dilemma

Nick Sabalausky SeeWebsiteToContactMe at semitwist.com
Fri Apr 11 15:22:18 PDT 2014


On 4/11/2014 3:54 PM, Michel Fortin wrote:
>
> Can destructors be @safe at all? When called from the GC the destructor
> 1) likely runs in a different thread and 2) can potentially access other
> destructed objects, those objects might contain pointers to deallocated
> memory if their destructor manually freed a memory block.
>

If destructors can't be @safe, that would seem to create a fairly 
sizable hole in the utility of @safe.



More information about the Digitalmars-d mailing list