Article View: borland.public.cppbuilder.nativeapi
Article #2524Re: Memory Leak - TForm or TStringGrid or DynamicArray
From: Remy Lebeau (TeamB)
Date: Fri, 09 Feb 2007 19:02
Date: Fri, 09 Feb 2007 19:02
32 lines
2304 bytes
2304 bytes
"Dan Mayo" <do_not_spam_dmayo2@netzero.com> wrote in message
news:45cc8d73$1@newsgroups.borland.com...
> The code again crashed sometime last night. EurekaLog points to
> where the crash occurred on the following line:
> std::auto_ptr<TSubForm> form(new TSubForm(NULL));
There is no way that auto_ptr can crash. The crash has to be occuring
inside your TForm itself during its construction, probably during the
DFM streaming. One of the controls is likely doing something it
shouldn't be doing.
> Oh why is it still crashing?
One thing I just noticed in your earlier message is the following:
__fastcall TForm2::TForm2(TComponent* Owner)
: TForm(Owner)
{
StringGrid1->ColCount = 0;
StringGrid1->RowCount = 0;
}
You can't set the RowCount to zero. TStringGrid requires at least 1
non-fixed row at all times. Why Borland designed TStringGrid that
way, I have no clue.
Are you still using that code in your TSubForm?
Gambit
Technical Details
Message-ID:
<45ccc54f$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news3.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-mailReferences:
<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>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,191a7d21d69bde32 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.nativeapi 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> Subject: Re: Memory Leak - TForm or TStringGrid or DynamicArray Date: Fri, 9 Feb 2007 11:02:00 -0800 Lines: 34 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 75.83.34.171 Message-ID: <45ccc54f$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1171047759 75.83.34.171 (9 Feb 2007 11:02:39 -0800) Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.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