Hi David, your first suggestion sounded promising, but didn't seem to work.
Is the Destroy Method fired at all if an object is still being referenced?
Thanks
Kev
>Kev,
>
>If you have references like:
>
>oX <-> oY
>
>meaning that oX and oY have pointers back and forth between them, and it's a class that understands this linking then you can explicitly code for it
>
>
class.Destroy
>this.oRef.oRef = .null.
>this.oRef = .null.
>
>In some complex multiple linked list structures I've created over time I've maintained a single linked list that runs through all objects, then the code looks something like:
>
>
>oRoot.Release()
>
>*class.Release
>local loObject, lnObjects, loNextObject
>lnObjects = 0
>loObject = this.oAllocationChain
>do while ! isnull( loObject )
> lnObjects = lnObjects + 1
> dimension laObjects[lnObjects]
> laObjects[lnObjects] = loObject
> loNextObject = loObject.oAllocationChain
> loObject.ReleasePointers()
> loObject = loNextObject
>enddo
>
>laObjects = .null.
>return
>
>*class.ReleasePointers
>this.oParent = .null.
>this.oChild = .null.
>this.oLeft = .null.
>this.oRight = .null.
>this.oAllocationChain = .null.
>
>
>>How can I safely clear all objects in memory when there are certain objects holding references to each other?
>>
>>Whenever I try it ends up crashing VFP, I understand that VFP's garbage collection cannot cope with this on it's own, and for the record I have code in the Destroy Method(s) which set all references to .NULL., but this doesn't seem to be enough.
>>
>>It's quite a complex situation, so I wouldn't be able to describe in words, only pictures.
>>
>>Any ideas on how to deal with this situation?