fix crash on shutdown

we were calling llarp::Context::HandleSignal from a non mainloop
thread when running as a win32 service. this caused issues with a non
clean destruction.

call our signal handler instead of llarp::Context::HandleSignal
pull/2045/head
Jeff Becker 2 years ago
parent dceef0b21e
commit 57b77fecb3
No known key found for this signature in database
GPG Key ID: 025C02EE3A092F2D

@ -601,6 +601,7 @@ SvcCtrlHandler(DWORD dwCtrl)
// tell service we are stopping
llarp::log::debug(logcat, "Windows service controller gave SERVICE_CONTROL_STOP");
llarp::sys::service_manager->system_changed_our_state(llarp::sys::ServiceState::Stopping);
handle_signal(SIGINT);
return;
case SERVICE_CONTROL_INTERROGATE:

@ -48,7 +48,6 @@ namespace llarp::sys
if (st == ServiceState::Stopping)
{
we_changed_our_state(st);
m_Context->HandleSignal(SIGINT);
}
}

Loading…
Cancel
Save