🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Closing application and Threads

#10750
From: Remy Lebeau (TeamB)
Date: Tue, 23 Mar 2004 20:35
21 lines
1708 bytes
"Jani" <jani@jvpp.com> wrote in message news:opr5bvfx0rcdadgw@localhost...

> Ok, the problem is, as I stated above when users closes the
> program, and the threads are still there, trying to report back
> to the allready freed main VCL using Synchronize(). Wont
> that cause problems?

Not if you terminate the threads before allowing the program to shut down.
Run through your list terminating the threads in the form's OnClose/Query
event.

> Btw, the threads are freed on terminate using FreeOnTerminate=true;

If you do that, you need to use the thread's OnTerminate event (or
DoTerminate() method) to remove the thread from the list.  Otherwise your
list will be left containing dangling pointers.  Are you actually doing
that?


Gambit
Technical Details
Message-ID: <40609d5a$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!proxad.net!newsfeed.tpinternet.pl!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <opr5bvfx0rcdadgw@localhost>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,16bcdba8970e0b14
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2004-03-23 12:40:22 PST
From: "Remy Lebeau \(TeamB\)" <gambit47.no.spam@no.spam.yahoo.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <opr5bvfx0rcdadgw@localhost>
Subject: Re: Closing application and Threads
Date: Tue, 23 Mar 2004 12:35:35 -0800
Lines: 23
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 67.22.138.253
Message-ID: <40609d5a$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1080073562 67.22.138.253 (23 Mar 2004 12:26:02 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!proxad.net!newsfeed.tpinternet.pl!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail