-
Object chaining
How could i delete an object from memory when the object has been created with New keyword.
Dim obj1 as MyClass
set obj1=new MyClass
' How to delete obj1 from memory ???
If i affect Nothing to obj1 will be the object removed from memory (like a Java garbage collector ) ?
thanx
-
Re: Object chaining
Set obj1 = Nothing
removes the object from memory (under normal circumstances)
-
Re: Object chaining
So if i understand and i have several object variables that point to the same object i must free all variables
ie :
Dim obj1,obj2,obj3 as myclass
set obj1=new myclass
set obj2=obj1
set obj3=obj1
' now obj1,obj2 and obj3 point to the same memory object
set obj1=nothing
set obj2=nothing
' ONLY the last next line frees the object ????
set obj3=nothing
-
Re: Object chaining
if you want to find out the truth, write a Class_Terminate method ("desctructor") in myclass and check when that method is called. That will tell you the truth about object destruction.