🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Thread and memory

#9255
From: Remy Lebeau (TeamB)
Date: Tue, 20 Jul 2004 17:43
35 lines
1946 bytes
"Sara T." <sarana@infoquest.co.th> wrote in message
news:40fce10f@newsgroups.borland.com...

>           Synchronize(UpdateDatabase);

You might want to look at using Sessions instead.  They are designed for
allowing multi-threaded access to databases.

>   FreeOnTerminate = true;

You should set that in the constructor instead.

>   Terminate();

There is no need to call that since you are not using the Terminated
property afterwards.  The thread will be terminated when Execute() exits.

>     strSQLString =     ADOQuery->SQL->Clear();

That statement won't work as Clear() does not return any value.

>   catch (...) {

That generally is not good to use for catching VCL exceptions.  You should
use this instead:

    catch(const Exception &)

>   delete ADOQuery;

Are you sure that your code reaches that line correctly?


Gambit
Technical Details
Message-ID: <40fd598d$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <40fb3d08@newsgroups.borland.com> <40fbf87b$1@newsgroups.borland.com> <40fbfd74$1@newsgroups.borland.com> <40fc1022$1@newsgroups.borland.com> <40fcab00@newsgroups.borland.com> <40fcc3d3$1@newsgroups.borland.com> <40fce10f@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,d35c53850c011fac
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <gambit47.no.spam@no.spam.yahoo.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References:  <40fb3d08@newsgroups.borland.com> <40fbf87b$1@newsgroups.borland.com> <40fbfd74$1@newsgroups.borland.com> <40fc1022$1@newsgroups.borland.com> <40fcab00@newsgroups.borland.com> <40fcc3d3$1@newsgroups.borland.com> <40fce10f@newsgroups.borland.com>
Subject: Re: Thread and memory
Date: Tue, 20 Jul 2004 10:43:34 -0700
Lines: 37
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: 68.69.17.41
Message-ID: <40fd598d$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1090345357 68.69.17.41 (20 Jul 2004 10:42:37 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail