diff options
author | John Ankarström <john@ankarstrom.se> | 2022-08-28 00:09:09 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2022-08-28 00:09:09 +0200 |
commit | 90c253dcfeb16a5972f913449422e3b5eabd92b8 (patch) | |
tree | 5451c394796654e970c7d7093e973f2c3e8ac18e /c/util.h | |
parent | fa9aa6a4418c77ac2a7c03cc73cfecc6caddb4ad (diff) | |
download | EpisodeBrowser-90c253dcfeb16a5972f913449422e3b5eabd92b8.tar.gz |
Set termination handler for fetch thread.
MSVC has separate handlers per thread.
Diffstat (limited to 'c/util.h')
-rw-r--r-- | c/util.h | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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 <typename F> struct Finally { |