🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #163

Re: TADOQuery Memory Leak

#163
From: Patrick Wong
Date: Thu, 26 Apr 2007 00:53
30 lines
1807 bytes
"Clayton Arends" <nospam_claytonarends@hotmail.com> wrote in message 
news:462f9bbe$1@newsgroups.borland.com...
>I forgot to ask.  Another point of memory leak could be the destruction of 
>your threads.  You didn't show how you are deleting them.

In my test only one thread is created.  The memory leak happens during the 
thread runs (every ADOQuery->Open() is called).  I explicitely terminate and 
delete it from the main thread:

void __fastcall TForm1::Button3Click(TObject *Sender)
{
  if(pDBThread != NULL)
  {
    pDBThread->Terminate();
    pDBThread->WaitFor();

    delete pDBThread;
    pDBThread = NULL;
  }
}

At that time the memory usage stops to grow.


> Are you setting FreeOnTerminate to true or are you deleting the thread in 
> some other way?
>

The FreeOnTerminate is set to false. 
Technical Details
Message-ID: <462ff80d$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!proxad.net!212.101.4.254.MISMATCH!solnet.ch!solnet.ch!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <462d7a19$1@newsgroups.borland.com> <462f9b39$1@newsgroups.borland.com> <462f9bbe$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,f6b9f007fd37682e
X-Google-Attributes: gid10698b,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Patrick Wong" <patrickwong@computer.org>
Newsgroups: borland.public.cppbuilder.database.ado
References: <462d7a19$1@newsgroups.borland.com> <462f9b39$1@newsgroups.borland.com> <462f9bbe$1@newsgroups.borland.com>
Subject: Re: TADOQuery Memory Leak
Date: Thu, 26 Apr 2007 08:53:33 +0800
Lines: 32
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 203.82.254.252
Message-ID: <462ff80d$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1177548813 203.82.254.252 (25 Apr 2007 17:53:33 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!proxad.net!212.101.4.254.MISMATCH!solnet.ch!solnet.ch!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail