🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #7545

Re: Self destructive 0bject/class... (Challange)

#7545
From: Remy Lebeau (TeamB)
Date: Wed, 09 Jul 2003 16:43
20 lines
1916 bytes
"Pang Fu" <nospam_pangfu@hotmail.com> wrote in message
news:3f0c21da@newsgroups.borland.com...
> Is it possible for an instance of a class to delete itself

Sure.  Simply delete the 'this' pointer.  Just make sure you don't make any
further accesses to any members of the class after that point, though, since
the object is gone and 'this' is now invalid.

>      Destruct TMyClass instance .. HOW?

    delete this;


Gambit

P.S. please do not cross-post.  It is against Borland's newsgroup guidelines
(http://www.borland.com/newsgroups).  Post questions only to the most
appropriate group, which in this case would have been the .language.cpp
group instead.
Technical Details
Message-ID: <3f0c4519$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!pln-e!extra.newsguy.com!lotsanews.com!skynet.be!skynet.be!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3f0c21da@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,9af595df0adad9f3
X-Google-Attributes: gid10cc67,public
X-Google-Thread: 102541,9af595df0adad9f3
X-Google-Attributes: gid102541,public
X-Google-Thread: 10db1e,9af595df0adad9f3
X-Google-Attributes: gid10db1e,public
X-Google-ArrivalTime: 2003-07-09 09:40:09 PST
From: "Remy Lebeau \(TeamB\)" <gambit47@yahoo.com>
Newsgroups: borland.public.cppbuilder.nativeapi,borland.public.cppbuilder.oodesign,borland.public.cppbuilder.students
References: <3f0c21da@newsgroups.borland.com>
Subject: Re: Self destructive 0bject/class... (Challange)
Date: Wed, 9 Jul 2003 09:43:41 -0700
Lines: 22
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 207.175.226.26
Message-ID: <3f0c4519$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1057768729 207.175.226.26 (9 Jul 2003 09:38:49 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!pln-e!extra.newsguy.com!lotsanews.com!skynet.be!skynet.be!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail