Re: Null out the current object... possible?
From: AC (AC_at_discussions.microsoft.com)
Date: 11/13/04
- Next message: Ziphyre: "cookies"
- Previous message: AC: "Re: Null out the current object... possible?"
- In reply to: Richard Blewett [DevelopMentor]: "Re: Null out the current object... possible?"
- Next in thread: Wilfried Mestdagh: "RE: Null out the current object... possible?"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 13 Nov 2004 03:45:01 -0800
My specific case is my object is a CustomProperty. When the property is
Deleted, it removes it's record form the database and I wanted to destroy the
object at the same time.
"Richard Blewett [DevelopMentor]" wrote:
> When you say you need to destroy it, what do you actually need to do (I'm asking this because you can't do what you are suggesting in .NET)?
>
> 1. Release the resources used by the Animal?
> 2. Free up the memory consumed by the animal?
> 3. Remove the Animal from a collection?
> 4. Re-initialize the Animal back to its original state?
> 5. Make the Animal's consumer refer to a null reference rather than this Animal instance?
> 6. Something else?
>
> Regards
>
> Richard Blewett - DevelopMentor
> http://www.dotnetconsult.co.uk/weblog
> http://www.dotnetconsult.co.uk
>
> 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
>
>
- Next message: Ziphyre: "cookies"
- Previous message: AC: "Re: Null out the current object... possible?"
- In reply to: Richard Blewett [DevelopMentor]: "Re: Null out the current object... possible?"
- Next in thread: Wilfried Mestdagh: "RE: Null out the current object... possible?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|