I don't know if it is leaving anything around... It might be simply failing to call the Delete method at times.
The list is empty at least. But that doesn't mean types haven't been left in ram.
Type Sprite Global SpriteRenderList:TList = New TList Global gid:Int = 0 Field id:Int = gid Method New() gid:+1 ListAddLast SpriteRenderList, Self End Method Method Delete() Print "REF CLEANED:id "+id End Method Method Remove() ListRemove SpriteRenderList, Self Print "Removed id "+id+", "+CountList(SpriteRenderList)+" total sprites now remaing" End Method End Type Local mt:Sprite = New Sprite Local mt2:Sprite = New Sprite Local mt3:Sprite = New Sprite Print "id>"+mt.id Print "id>"+mt2.id Print "id>"+mt3.id Print CountList(Sprite.SpriteRenderList) mt.Remove; mt=Null; GCCollect() Print CountList(Sprite.SpriteRenderList) mt2.Remove; mt2=Null; GCCollect() Print CountList(Sprite.SpriteRenderList) mt3.Remove; mt3=Null; GCCollect() Print CountList(Sprite.SpriteRenderList) GCCollect() GCCollect() End
The list is empty at least. But that doesn't mean types haven't been left in ram.