Restart application on frozen exception

delphi package - automated exception handling
Post Reply
borax1974
Posts: 1
Joined: Fri Dec 26, 2014 1:32 pm

Restart application on frozen exception

Post by borax1974 »

Hi

I wan't to restart the application as soon as it detects a frozen main thread (without a message box). All other exceptions will be handled.
I checked the "detect frozen main thread" option. How can I achieve this?

Best regards

Bora Aydemir

(Mad except 4.0.11, Delphi XE)
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: Restart application on frozen exception

Post by madshi »

You can install an exception handler by calling RegisterExceptionHandler(yourHandler, epQuickFiltering, stDontSync) and then in your handler you can use "if exceptIntf.Source = esAntiFreezeCheck then RestartApplication;".
oickler
Posts: 3
Joined: Tue May 28, 2019 12:20 pm

Re: Restart application on frozen exception

Post by oickler »

How to solve the problem when the application is a service?
iconic
Site Admin
Posts: 1065
Joined: Wed Jun 08, 2005 5:08 am

Re: Restart application on frozen exception

Post by iconic »

@oickler,

Unless something has changed madExcept doesn't support RestartApplication out of the box. Madshi has answered a similar question here:

viewtopic.php?f=4&t=28417

--Iconic
Post Reply