Memory managment.

  • Thread starter Thread starter pmclinn
  • Start date Start date
P

pmclinn

Newbie question:

If I build a dll, how do I create a dispose method for it? Is it as
simple as adding the following code?

Public Overloads Overrides Sub Dispose()
MyBase.Dispose()
components.Dispose()
End Sub


I have several classes that pass back delegates and they all seem to
work great but I cannot figure out how to dispose of my classes after I
substanciated them.

-Peter
 
Sample Class: Here is a class function that returns a function. Do I
need to do any special to this class?



imports whitecliff.webzinc

Public Class SuckWebpages
dim z as new webzinc

....New(url as string)

public function getpagesplit() as string() 'rawhtml
dim returnPageLines as string()
returnPageLines = split(z.openpage(url), controlchars.newline)
z.dispose
return returnPageLines

end sub
end class
 
pmclinn said:
Sample Class: Here is a class function that returns a function. Do I
need to do any special to this class?



imports whitecliff.webzinc

Public Class SuckWebpages
dim z as new webzinc

...New(url as string)

public function getpagesplit() as string() 'rawhtml
dim returnPageLines as string()
returnPageLines = split(z.openpage(url), controlchars.newline)
z.dispose
return returnPageLines

In this case there is no need for implementing 'IDisposable' as far as I
see.
 
Back
Top