🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Memory Leak - TForm or TStringGrid or DynamicArray

#2527
From: Dan Mayo
Date: Fri, 09 Feb 2007 20:01
44 lines
3096 bytes
Remy Lebeau (TeamB) wrote:
> There is no way that auto_ptr can crash.  
Oh but it did, I'd send you the EurekaLog if it would prove anything or 
satisfy anything.

> Are you still using that code in your TSubForm?
No.  The subform has really nothing on it.  Here is all the code on the 
subform, with the names changed to protect the innocent:

//---------------------------------------------------------------------------
__fastcall TSubForm::TSubForm(TComponent* Owner)
         : TForm(Owner)
{
   Stopped = false; //private bool
   //note there are two other components on the form, a TProgressBar and 
a  TLabel.
}
//---------------------------------------------------------------------------
void __fastcall TSubForm::StopProcessButtonClick(TObject *Sender)
{
    StopButton->Visible = false; //TButton
    Stopped = true;
}
//---------------------------------------------------------------------------
void __fastcall TSubForm::FormShow(TObject *Sender)
{
    StopButton->Visible = true;
    Stopped = false;
}
//---------------------------------------------------------------------------



On a lighter note, I got rid of the static std::auto_ptr, and changed 
the function call so that instead of dynamically creating the subform 
during that function, I now create the subform only once in the main 
forms constructor and then the function simply shows and hides it.  I 
didn't want to do it that way, but as I said this is a lighter note; and 
the code is working. No Lint errors, no Eureka Log errors yet; and no 
CodeGuard errors.

So in any event, like it or not I think I have the problem resolved by 
simply deciding to no longer dynamically create the subform.  Now to 
better things.
Technical Details
Message-ID: <45ccd362$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!homer!news.glorb.com!news-spur1.glorb.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!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> <45ccc54f$1@newsgroups.borland.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 14:01:42 -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> <45ccc54f$1@newsgroups.borland.com>
In-Reply-To: <45ccc54f$1@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 216.174.165.174
Message-ID: <45ccd362$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1171051362 216.174.165.174 (9 Feb 2007 12:02:42 -0800)
Lines: 44
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!homer!news.glorb.com!news-spur1.glorb.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail