Re: Destroying objects.
- From: "qwert" <nospam@xxxxxxxxx>
- Date: Thu, 23 Feb 2006 17:12:57 +0100
I want to set all references to an object to Nothing in one statement.
Instead of setting X references to Nothing, I would like to call one
statement with one of the X references, setting them all to Nothing.
I'm not interested in when the object is destroyed. As long as all the
references are Nothing so the garbage collector knows it's good to go.
"Brian Gideon" <briangideon@xxxxxxxxx> wrote in message
news:1140709793.609331.257730@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
No. That's not possible. You have very little control over when an
object is actually destroyed. That's the job of the garbage collector.
What you do have complete control over is how many references there
are to an object.
If you're wanting deterministric finalization then use the IDisposable
interface and adhere to the associated design pattern.
If you're wanting to use advanced techniques for controlling the
lifetime of objects you can use the WeakReference class.
Can you explain a little more about what you're wanting to accomplish?
Brian
qwert wrote:
What I meant was:
Dim objA as New A
Dim objAR As A
objAR = objA
KILL(objA)
If objAR is Nothing then blnGreat = True
.
- Follow-Ups:
- Re: Destroying objects.
- From: CMM
- Re: Destroying objects.
- From: Brian Gideon
- Re: Destroying objects.
- References:
- Destroying objects.
- From: qwert
- Re: Destroying objects.
- From: qwert
- Re: Destroying objects.
- From: Brian Gideon
- Destroying objects.
- Prev by Date: Re: Simple question - Datagrid - how to detect change in a row cell?
- Next by Date: Re: How is it possible ...
- Previous by thread: Re: Destroying objects.
- Next by thread: Re: Destroying objects.
- Index(es):
Relevant Pages
|