|
-
October 4th, 1999, 06:52 AM
#1
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
-
October 4th, 1999, 07:01 AM
#2
Re: Object chaining
Set obj1 = Nothing
removes the object from memory (under normal circumstances)
-
October 4th, 1999, 07:51 AM
#3
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
-
October 4th, 1999, 08:21 AM
#4
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|