🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Memory Leak - TForm or TStringGrid or DynamicArray

#2514
From: Dan Mayo
Date: Fri, 09 Feb 2007 16:23
19 lines
2109 bytes
> I'd be very tempted to let it leak. Yes, leaking is usually bad news,
> but a once-per-program leak is (assuming no weird transactions are
> expected during cleanup) not normally a problem. Except that CodeGuard
> will moan. So:
> 
>   void __fastcall TForm1::Button1Click(TObject *Sender)
>   {
>     static TForm* subform(new TForm(this));
>   }
> 
> End of lifetime with forms can be a problem.
> 

So the exception reported when the static case of a form above is used 
is a fact-of-life?

BTW, in this case, CodeGuard doesn't moan; the program reports an 
exception error and the pc politely asks me if I would like to email 
bill gates with the details.
Technical Details
Message-ID: <45cca038$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <45c7810f@newsgroups.borland.com> <45c7dc8d$1@newsgroups.borland.com> <45c89ec6@newsgroups.borland.com> <45ca4546$1@newsgroups.borland.com> <0sqks2t4c90epuc62bv635h36cqeat0ujd@4ax.com> <45cb3451$1@newsgroups.borland.com> <ptems2p2k2rquqdiao805ik2fhg6jl9n9a@4ax.com> <45cb5f6b@newsgroups.borland.com> <45cba995$1@newsgroups.borland.com> <45cbb722$1@newsgroups.borland.com> <45cc8d73$1@newsgroups.borland.com> <45cc9095$1@newsgroups.borland.com> <c05ps2h65qgi1fng2bjksfv1v2pafncfqu@4ax.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,191a7d21d69bde32
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Fri, 09 Feb 2007 10:23:24 -0600
From: Dan Mayo <do_not_spam_dmayo2@netzero.com>
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: Memory Leak - TForm or TStringGrid or DynamicArray
References: <45c7810f@newsgroups.borland.com> <45c7dc8d$1@newsgroups.borland.com> <45c89ec6@newsgroups.borland.com> <45ca4546$1@newsgroups.borland.com> <0sqks2t4c90epuc62bv635h36cqeat0ujd@4ax.com> <45cb3451$1@newsgroups.borland.com> <ptems2p2k2rquqdiao805ik2fhg6jl9n9a@4ax.com> <45cb5f6b@newsgroups.borland.com> <45cba995$1@newsgroups.borland.com> <45cbb722$1@newsgroups.borland.com> <45cc8d73$1@newsgroups.borland.com> <45cc9095$1@newsgroups.borland.com> <c05ps2h65qgi1fng2bjksfv1v2pafncfqu@4ax.com>
In-Reply-To: <c05ps2h65qgi1fng2bjksfv1v2pafncfqu@4ax.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 216.174.165.174
Message-ID: <45cca038$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1171038264 216.174.165.174 (9 Feb 2007 08:24:24 -0800)
Lines: 19
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail