aboutsummaryrefslogtreecommitdiff
path: root/c/data.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'c/data.cpp')
-rw-r--r--c/data.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/c/data.cpp b/c/data.cpp
index a75111a..32e059f 100644
--- a/c/data.cpp
+++ b/c/data.cpp
@@ -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)