By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,681 Members | 1,329 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,681 IT Pros & Developers. It's quick & easy.

Object destruction event

P: n/a
Is there a way in VB to get a notification when an object
is destroyed when that object does not have a terminate
event?

I am using a control that does not have a notification
event when it is destroyed. I need to know when the
object is destroyed so I can do some cleanup.

Thanks Chewie2112
Nov 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
There is much that can be (and has been) said on this. Look for help on
Garbage Collection, The Dispose Method, The Finalize Method.

In a nutshell, in .NET you don't/won't know for sure when an object is
removed from the memory heap. You will know when it falls out of scope and
the Dispose method will fire at that point. Finalize with fire when the
object is actually being removed from the heap, but since you don't know for
sure when that is, you want to be very careful about using it.

"Chewie2112" <Ch********@someplace.com> wrote in message
news:05****************************@phx.gbl...
Is there a way in VB to get a notification when an object
is destroyed when that object does not have a terminate
event?

I am using a control that does not have a notification
event when it is destroyed. I need to know when the
object is destroyed so I can do some cleanup.

Thanks Chewie2112

Nov 20 '05 #2

P: n/a
Thanks for the quick reply. But I noticed I posted to the
DotNet group instead of the General VB group (I am not
using .Net). Sorry for waisting your time.

Chewie2112.
-----Original Message-----
There is much that can be (and has been) said on this. Look for help onGarbage Collection, The Dispose Method, The Finalize Method.
In a nutshell, in .NET you don't/won't know for sure when an object isremoved from the memory heap. You will know when it falls out of scope andthe Dispose method will fire at that point. Finalize with fire when theobject is actually being removed from the heap, but since you don't know forsure when that is, you want to be very careful about using it.
"Chewie2112" <Ch********@someplace.com> wrote in message
news:05****************************@phx.gbl...
Is there a way in VB to get a notification when an object is destroyed when that object does not have a terminate
event?

I am using a control that does not have a notification
event when it is destroyed. I need to know when the
object is destroyed so I can do some cleanup.

Thanks Chewie2112

.

Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.