Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Sep : Re: TIdTCPServer shutdown
| Subject: | Re: TIdTCPServer shutdown |
| Posted by: | "Remy Lebeau (TeamB)" (no.spam@no.spam.com) |
| Date: | Fri, 14 Sep 2007 15:07:26 |
"Toby Piper" <news@CompCraft.com> wrote in message
news:46eb0189$1@newsgroups.borland.com...
> I had the Memo.Lines.Add method wrapped in a critical section
That will never work safely. You can't protect UI resources from the main
thread like that, because the main thread does not participate in the
critical section for its own accesses. So you have to access the UI
indirectly using a synched operation. That way, it is always accessed in
the context of the main thread, never in the context of a worker thread.
Gambit