Jump to content
Xtreme .Net Talk

Recommended Posts

Posted (edited)

Could someone just clear this up please?

 

Dim frmEdit as new frmEdit
frmEdit.Show()

'Do i need this?  Or does closing the form do this automatically?
frmEdit.Dispose()

 

Also if i am calling my own (simple codebased) class from within a module, do i need to dispose it? If so how?

 

Thanks.

Edited by Jay1b
Posted

If you call Close (or if something else does it), then you don't need to call Dispose.

 

As for your own class, you won't even be able to call Dispose unless you somehow make it implement IDisposable (either directly or inheriting a class that implements it, or for that matter, implementing an interface that inherits it). Then if you do, then yeah, you should be calling Dispose.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...