Re: Garbage Collection - dim x as y versus dim x as new y
- From: "hazz" <hazz@sonic_net>
- Date: Sun, 31 Jul 2005 13:21:34 -0700
thank you michel. If an object or type goes out of scope, it is elgible for
garbage collection. I like that simple concept.
-greg
"m.posseth" <michelp@xxxxxxxxxxxxxxx> wrote in message
news:e$3cqyglFHA.1372@xxxxxxxxxxxxxxxxxxxxxxx
> Well if the object goes out of scope it will automaticly be released
> although i am still one of those people who like to set object pointers to
> Nothing
>
>
> however in the example you gave setting it to a new object pointer is
> sufficient
>
> dim x as new y
> try
> x.foo()
>
>
>
> ' dim x as y ------- this is not necessary as the declaraion is above the
> try statement it is still in scope
> try
> x = new y
> x.foo()
>
>
> regards
>
> Michel Posseth
>
>
>
>
> "hazz" <hazz@sonic_net> wrote in message
> news:%235MnmoglFHA.1148@xxxxxxxxxxxxxxxxxxxxxxx
>> with respect to garbage collection. Does it make any difference? My
>> current understanding is that (to avoid memory leaks, ie memory
>> accumulation - never letting go of the memory something has referenced)
>> it isn't so much HOW an object reference (or string or byte())
>> is created, it is more about no longer having a reference to an object or
>> other type.
>> If so, how do I remove a reference to something when I no longer need it?
>> thx, -hazz
>>
>> dim x as new y
>> try
>> x.foo()
>>
>>
>>
>> dim x as y
>> try
>> x = new y
>> x.foo()
>>
>>
>>
>>
>
>
.
- Follow-Ups:
- Re: Garbage Collection - dim x as y versus dim x as new y
- From: _AnonCoward
- Re: Garbage Collection - dim x as y versus dim x as new y
- References:
- Garbage Collection - dim x as y versus dim x as new y
- From: hazz
- Re: Garbage Collection - dim x as y versus dim x as new y
- From: m.posseth
- Garbage Collection - dim x as y versus dim x as new y
- Prev by Date: Re: Garbage Collection - dim x as y versus dim x as new y
- Next by Date: Re: Garbage Collection - dim x as y versus dim x as new y
- Previous by thread: Re: Garbage Collection - dim x as y versus dim x as new y
- Next by thread: Re: Garbage Collection - dim x as y versus dim x as new y
- Index(es):
Relevant Pages
|