Newsgroups : Borland : borland.public.delphi.rtl.win32 : 2005 Feb : Create objects inside TThread.Execute?

www.cryer.info
Managed Newsgroup Archive

Create objects inside TThread.Execute?

Subject:Create objects inside TThread.Execute?
Posted by:"Kjell Rilbe" (krilbe...@mblock.home.se)
Date:Wed, 23 Feb 2005 10:09:14

Hi,

Just starting a little thread programming. Inside the TThread.Execute I
want to create the following objects:

TStringList
TADOConnection
TADODataSet

They will all be freed later in TThread.Execute (inside a finally block).

Can I do this safely?

The TStringList will be used in a Synchronize:d call but the others are
used *only* directly inside TThread.Execute.

Thanks,
Kjell
--
---------------------------------------------------------------------------
Kjell Rilbe
Home: +46 8 7610734
Cell: +46 733 442464
---------------------------------------------------------------------------
"If there's a price for bein' me, that's one I'll have to pay"
Aaron Tippin
---------------------------------------------------------------------------

Replies:

www.cryer.info
Managed Newsgroup Archive