Subject Re: effect of nullifying an object reference
From Bruce Beacham <bbeacham@no_plm_lowman.co.uk>
Date Wed, 30 Sep 2020 23:47:18 +0100
Newsgroups dbase.getting-started

I'd say that if there is another variable or property that refers to the
object, in addition to the reference that variable oCGI holds, then No.

My understanding is that dBASE's internals will check for objects with
no references and will release them and their memory.

But for an explicit destruction, consider using
release object oCGI

_Then_ release the memory variable, which will now be empty:
release oCGI

'release object' is necessary in this situation:
oo = new object()
oo.oCGI = new assocarray()

You cannot release a property of an object, you can only assign
something else (like null) to it:
oo.oCGI = null

So to be sure of releasing memory, you can instead issue:
release object oo.oCGI


Bruce Beacham

On 30/09/2020 20:56, Gaetano wrote:
>
> Hi All,
>
> If I nullify an object such as oCGI wiht oCGI = Null, does that also
> release the memory that the assocArray was using?
>
> Cheers,
> Gaetano.