Array of class intances

Jarrett Billingsley kb3ctd2 at yahoo.com
Wed Apr 9 16:22:26 PDT 2008


"YY" <yyudhistira at hotmail.com> wrote in message 
news:ftj38l$19pr$1 at digitalmars.com...
>
> Great, thanks for the hints. I have another question. Do I have to delete 
> each and every member of the array? Like this :
>
> foreach (ref i; inst) delete i;
> inst.length = 0;
>
> If I only do this :
>
> inst.length = 0;
>
> will all the instance items be automatically captured by garbage 
> collector?

If there are no other references to them, they will. 




More information about the Digitalmars-d-learn mailing list