Article View: borland.public.cppbuilder.nativeapi
Article #1491Re: std::auto_ptr<> Memory Leak?
From: Thomas Maeder [TeamB]
Date: Mon, 13 Aug 2007 20:04
Date: Mon, 13 Aug 2007 20:04
18 lines
1673 bytes
1673 bytes
Dan <Dan@do.not.spam> writes:
> I have the following code:
>
> std::auto_ptr<TStringList> Times(new TStringList());
> for (int i=0;i<100; i++)
> {
> String StartTime = Now();
> std::auto_ptr<TADOQuery> Query(new TADOQuery(this));
> Query->Connection = Database;
> Query->SQL->Text = "Select * from Customers where Cust_Id = "+(String)i; //yes, each customer has the same amount of information
> Query->Active = true;
> String StopTime = Now();
> Times->Add(StartTime+"\t"+EndTime);
Are you sure that this is the code? EndTime isn't declared at this point.
> }
Technical Details
Message-ID:
<m24pj3qjz1.fsf@glue.ch>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news1.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:
<46c0acfc$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,a638a12efe982a3a
X-Google-Attributes: gid10cc67,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: std::auto_ptr<> Memory Leak?
References: <46c0acfc$1@newsgroups.borland.com>
From: maeder@glue.ch (Thomas Maeder [TeamB])
Organization: TeamB
X-Face: ":yn4zt^A_dn>6~{YJmu^B\'4w)e:apPM\VC=Dvf&*tASxX9|BYczkFd$xr.$vNSZ[3Uobr p]c4\+\l){!WQI.$]veP({HLd;CDYH?iN
Date: Mon, 13 Aug 2007 22:04:50 +0200
Message-ID: <m24pj3qjz1.fsf@glue.ch>
User-Agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Jumbo Shrimp, linux)
Cancel-Lock: sha1:tAgiIVGf10NXc3+tUJcIEOVDjQs=
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
NNTP-Posting-Host: 84.73.227.225
X-Trace: newsgroups.borland.com 1187035488 84.73.227.225 (13 Aug 2007 13:04:48 -0700)
Lines: 18
X-Authenticated-User: tmaeder
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.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