From 90c253dcfeb16a5972f913449422e3b5eabd92b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Sun, 28 Aug 2022 00:09:09 +0200 Subject: Set termination handler for fetch thread. MSVC has separate handlers per thread. --- c/util.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'c/util.h') diff --git a/c/util.h b/c/util.h index 729e64d..0d8a835 100644 --- a/c/util.h +++ b/c/util.h @@ -10,6 +10,15 @@ #define CONCAT(a, b) CONCAT_IMPL(a, b) #define _ CONCAT(unused_, __LINE__) +#define SET_TERMINATE \ + std::set_terminate([]() noexcept \ + { \ + ShowException( \ + L"Episode Browser was terminated due to an error: %s", \ + L"Fatal Error", MB_ICONERROR); \ + _Exit(1); \ + }) + template struct Finally { -- cgit v1.2.3