diff options
Diffstat (limited to 'c/data.cpp')
-rw-r--r-- | c/data.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -118,7 +118,7 @@ void WaitFor(Window& window, void (*f)(unsigned char*)) static auto procThread = [](void (*f)(unsigned char*)) noexcept -> void { - SET_TERMINATE; + std::set_terminate(OnTerminate); while (!(sig & READY)) Sleep(100); sig = 0; @@ -152,7 +152,8 @@ void WaitFor(Window& window, void (*f)(unsigned char*)) s_window = &window; std::thread(procThread, f).detach(); s_window->Status(L".", 1); - Prefer(iTimer = SetTimer(nullptr, iTimer, 500, procTimer)); + if (!(iTimer = SetTimer(nullptr, iTimer, 500, procTimer))) + throw Err(WINDOWS, L"Timer could not be started: %s"); } void FetchData(unsigned char* sig) |