G
Guest
Could someone please verify if what I am doing as follow is corrected:
1. when dealing with custom class objects:
.....
public myObject as myClass
myObject as New myClass
.......here I am going to fill up myObject with info....tons of them
myObject = nothing
System.GC.Collect()
Is this correct? I don't want to directly include System.GC.Collect() into
myClass terminate sub because there are soooo many local variables to mark
for delete. So will this works or there is another better way?
2. When working with form class, where my form class is named "myForm"
myForm.DefInstance = nothing
System.GC.Collect()
or should I replace those two lines with:
myForm.DefInstance.Dispose(True)
Which one garantee that data will be deleted from machine memory?
Thanks.
1. when dealing with custom class objects:
.....
public myObject as myClass
myObject as New myClass
.......here I am going to fill up myObject with info....tons of them
myObject = nothing
System.GC.Collect()
Is this correct? I don't want to directly include System.GC.Collect() into
myClass terminate sub because there are soooo many local variables to mark
for delete. So will this works or there is another better way?
2. When working with form class, where my form class is named "myForm"
myForm.DefInstance = nothing
System.GC.Collect()
or should I replace those two lines with:
myForm.DefInstance.Dispose(True)
Which one garantee that data will be deleted from machine memory?
Thanks.