G
Guest
I exhaustively dispose/close anything database related and have managed to
control connection leaks.
However, I was wondering about the necessity to use Dispose on non-database
resources.
1. Take this code:
Sub X ()
Dim oItem as DataGridItem
For Each oItem In ctlMembers.Items
Call DoSomething(oItem)
Next
End Sub
The DataGridItem supports a Dispose method. Should I be using it?
Also, should I be setting oItem = Nothing
2. I have an object that was written by a 3rd party that didn't seem to
cause memory leaks when used in VB6. It doesn't have an explicit cleanup
method like Dispose. Do you think it is still getting cleaned up when used
in .Net.
Thanks =)
control connection leaks.
However, I was wondering about the necessity to use Dispose on non-database
resources.
1. Take this code:
Sub X ()
Dim oItem as DataGridItem
For Each oItem In ctlMembers.Items
Call DoSomething(oItem)
Next
End Sub
The DataGridItem supports a Dispose method. Should I be using it?
Also, should I be setting oItem = Nothing
2. I have an object that was written by a 3rd party that didn't seem to
cause memory leaks when used in VB6. It doesn't have an explicit cleanup
method like Dispose. Do you think it is still getting cleaned up when used
in .Net.
Thanks =)