class.Destroy this.oRef.oRef = .null. && clear the pointer back to me this.oRef = .null. && clear my pointer to himIn 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] && temp array maintaining a ref to each laObjects[lnObjects] = loObject loNextObject = loObject.oAllocationChain loObject.ReleasePointers() loObject = loNextObject enddo laObjects = .null. && remove last ref to each object so they finally destruct 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?