Finalize GC memory

Steven Schveighoffer schveiguy at yahoo.com
Tue Jun 18 06:16:36 PDT 2013


On Tue, 18 Jun 2013 03:59:37 -0400, Namespace <rswhite4 at googlemail.com>  
wrote:

>> I'd be worried about whether it actually called the destructors of the  
>> members
>> of the struct. IIRC, you actually have to play around with TypeInfo in  
>> order
>> to be able to correctly manually destroy a struct rather than simply  
>> calling
>> its __dtor method, but it's not something that I ever do, so I don't  
>> remember
>> the details. Regardless, if destroy doesn't actually destroy a struct
>> correctly, then that's a bug and should be reported.
>>
>> - Jonathan M Davis
>
> Why the members could not be destroyed? Could you give me an example?
> And did you have a link, that explain how I should use TypeInfo to  
> destroy the struct correctly?

Be careful what hidden members you call, some of them are not what you  
think they are.

As a guide, you should take a look at the destroy function in object to  
see the proper method of destroying things.

-Steve


More information about the Digitalmars-d-learn mailing list