Page 1 of 1

Restart application on frozen exception

Posted: Tue Nov 03, 2015 12:34 pm
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)

Re: Restart application on frozen exception

Posted: Tue Nov 03, 2015 1:55 pm
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;".

Re: Restart application on frozen exception

Posted: Tue Nov 19, 2019 9:10 am
by oickler
How to solve the problem when the application is a service?

Re: Restart application on frozen exception

Posted: Tue Nov 19, 2019 7:06 pm
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