Consider this code:
When does this frm object get disposed? I'm pretty sure that frm gets slated for disposal when execution leaves the MyBase.Click sub.
I understand this code stops all execution until it is closed so the Dispose method can be called right after it.
The reason i ask this is because i have an app that when i close the main form it still stays running in memory and i have to 'End Process' it.
I think there may be some things in memory that arent being cleared.
Any ideas why the program wont close?
Code:
Private Sub Form1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Click
Dim frm As New Form1
frm.Show()
End Sub
When does this frm object get disposed? I'm pretty sure that frm gets slated for disposal when execution leaves the MyBase.Click sub.
Code:
Private Sub Form1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Click
Dim frm As New Form1
frm.ShowDialog()
frm.Dispose
End Sub
I understand this code stops all execution until it is closed so the Dispose method can be called right after it.
The reason i ask this is because i have an app that when i close the main form it still stays running in memory and i have to 'End Process' it.
I think there may be some things in memory that arent being cleared.
Any ideas why the program wont close?