Article View: borland.public.cppbuilder.database.ado
Article #166Re: TADOQuery Memory Leak
From: Clayton Arends
Date: Thu, 26 Apr 2007 03:13
Date: Thu, 26 Apr 2007 03:13
24 lines
2055 bytes
2055 bytes
> The TADOConnection and TADOQuery objects are declared as private members > of the thread and created at the thread's constructor. Is it still an > issue calling CoInitalize() and CoUninitialize() in the thread's context? I'm not exactly sure what you mean by "is it still an issue". Any code that is executed in a thread's constructor and destructor are executing in the context of the main application thread. TThread descendants don't start executing in their own context until Execute() is invoked. However, I took another look at my test app that replicates your behavior. I thought the by additionally calling OleInitialize() in the main application thread the memory leak went away. But, it appears that I was mistaken. I am currently trying to figure out what is going on here. >>> Application->ProcessMessages(); >> >> Don't call this from within any thread other than the main application >> thread. > > Comment out that does not help. I didn't say it would help ... just don't do it. ;-) - Clayton
Technical Details
Message-ID:
<463018d2$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<462d7a19$1@newsgroups.borland.com> <462f9b39$1@newsgroups.borland.com> <462ffa42$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: "Clayton Arends" <nospam_claytonarends@hotmail.com> Newsgroups: borland.public.cppbuilder.database.ado References: <462d7a19$1@newsgroups.borland.com> <462f9b39$1@newsgroups.borland.com> <462ffa42$1@newsgroups.borland.com> Subject: Re: TADOQuery Memory Leak Date: Wed, 25 Apr 2007 20:13:44 -0700 Lines: 26 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: 71.93.4.10 Message-ID: <463018d2$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1177557202 71.93.4.10 (25 Apr 2007 20:13:22 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail