Re: Null out the current object... possible?

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: AC (AC_at_discussions.microsoft.com)
Date: 11/13/04


Date: Sat, 13 Nov 2004 03:44:01 -0800

Nice analogy...

I could do that, and I am... just wondering if this was possible.

"Rene" wrote:

> The object can't destroy itself. Its like if a person tried to eat his or
> herself (don't get nasty now) it will come down to the point where the mouth
> will have to eat the mouth and that is not possible!
>
>
>
> If you need to destroy it, why not have the object that calls the "Delete"
> method of the class also set the object to null?
>
>
> "AC" <AC@discussions.microsoft.com> wrote in message
> news:07CCD0E4-35C1-4C3C-A764-F7624306DB7D@microsoft.com...
> >I have the need to destory the current object when a method is called.
> >Such
> > as:
> >
> > public class Animal{
> > public string animalType = string.Empty;
> > public void Delete(){
> > this = null;
> > }
> > }
> >
> > When I compile it, it throws an error. Is this not possible? I know the
> > user of class Animal can set it to null on his own, but was hoping I could
> > do
> > this.
> >
> > -AC
>
>
>



Relevant Pages

  • Re: Trying to get dog to come
    ... I'm not sure your analogy works. ... is that the dog doesn't understand-- yet. ... get her to put it in her mouth. ... Once the ball was in her mouth, ...
    (rec.pets.dogs.behavior)
  • Re: Fly Tie-ers
    ... wipe the froth from your mouth... ... Go kick your poor dog, ... You enjoy being a nasty bitter old man...? ... are a nasty little dumbo shitbag, ...
    (rec.outdoors.fishing.fly)
  • Re: Unutterable peasant.
    ... society and yet allow nasty little turds like him to mouth off on the ... wotbut he can cook. ...
    (uk.rec.sheds)
  • Re: From My Cold Dead Hands
    ... 'gun/wrench' analogy? ... Then everything you are foaming at the mouth about is ...
    (rec.arts.sf.written)
  • Re: Great SWT Program
    ... You are wrong, Bent. ... None of the nasty things that you have said or implied about me are at ... despite Bent's lying and dishonest manipulation ... my own mouth. ...
    (comp.lang.java.programmer)