eg.
for a:mytype=eachin mytype_Li
mytype_li.remove a
delete a<-------------How do i free this?!?
next
for a:mytype=eachin mytype_Li
mytype_li.remove a
delete a<-------------How do i free this?!?
next
a = new MyType 'Create an instance pointed by the 'a' variable a = null 'a no longer points to the previous instance, so the previous instance is deleted automatically.
b = new MyType 'Create a new MyType instance pointed by b c = b 'C points to the same MyType instance than b b = null 'b no longer points to the MyType instance, but the instance is not deleted becouse C is still pointing it.
Type MyType1 Field X:MyType2 end Type Type MyType2 Field Y:MyType1 end Type 'Create instances a = new MyType1 'a points to a new instance of MyType1 b = new MyType2 'b points to a new instance of MyType2 'Assign cross references: (bad design) a.X = b b.Y = a a = null 'MyType1 instance is not deleted becouse it is pointed by the Y field of the MyType2 instance. b = null 'MyType2 instance is not deleted also, becouse it is pointed by the X field of the undeleted MyType1 instance.