🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Behaviour of a crashing TThread

#2363
From: Remy Lebeau (TeamB)
Date: Tue, 06 Mar 2007 21:53
22 lines
1779 bytes
"Goran Ekstrom" <goek!removeantispam!@telia.com> wrote in message
news:45edd2bc$1@newsgroups.borland.com...

> I seem to remember that a crashing TThread does not pop up
> the familiar "Application problem" message box but just silently
> "dies" in the background. Correct?

Yes, that is correct.

> If so, how do you catch crashes in threads?

Wrap your Exceute() code with a try..catch block.  If you are using
BCB 6+, you can alternatively override the virtual DoTerminate()
method and check if the thread's FatalException property is NULL or
not.  If you are using BCB 5 or earlier, you can still override
DoTerminate(), but there is no FatalException property, so you would
need to use your own variable that Execute() can set if it exits
gracefully.


Gambit
Technical Details
Message-ID: <45ede2e2$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!news.glorb.com!newsgate.cistron.nl!xs4all!news2.euro.net!213.132.189.2.MISMATCH!multikabel.net!feed20.multikabel.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <45edd2bc$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,145ba2b5cddc00ba
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <45edd2bc$1@newsgroups.borland.com>
Subject: Re: Behaviour of a crashing TThread
Date: Tue, 6 Mar 2007 13:53:25 -0800
Lines: 24
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: 75.83.34.171
Message-ID: <45ede2e2$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1173218018 75.83.34.171 (6 Mar 2007 13:53:38 -0800)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!news.glorb.com!newsgate.cistron.nl!xs4all!news2.euro.net!213.132.189.2.MISMATCH!multikabel.net!feed20.multikabel.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail