Sorry, I haven't read all you posts. But I would recommend the following to avoid Memory Leaks:
Now all you have to do is checking every Link to an YourType once a Frame with Deletecheck. Simply "DeleteCheck(YourLink)". If you also want to know, whether the Object was Deleted in this Frame or not, use this:
If you don't need the Link for you Final Action, the following will do:
Type YourType Field bIsDeleted:Byte Method Remove:Byte() If bIsDeleted = False Then 'Place your One-Time-Deleting-Actions here. 'For Example: Removing Object from global List. End If bIsDeleted = True Return Tru End Method Function DeleteCheck:Byte(objVarCheck:YourType) If objVarCheck = Null Then Return False If objVarCheck.bIsDeleted = True Then objVarCheck = Null End If Return True End Function End Type
Now all you have to do is checking every Link to an YourType once a Frame with Deletecheck. Simply "DeleteCheck(YourLink)". If you also want to know, whether the Object was Deleted in this Frame or not, use this:
Local objTemp:YourType = objRealLink2Check If YourType.DeleteCheck(objTemp) = True And objTemp = Null Then 'Now do your Deleting-Actions you need objRealLink2Check for. objRealLink2Check = Null End If
If you don't need the Link for you Final Action, the following will do:
If YourType.DeleteCheck(objRealLink2Check) = True And objRealLink2Check = Null Then End If