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
This commit is contained in:
Jeff Becker 2022-10-31 10:53:56 -04:00
parent dceef0b21e
commit 57b77fecb3
No known key found for this signature in database
GPG Key ID: 025C02EE3A092F2D
2 changed files with 1 additions and 1 deletions

View File

@ -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:

View File

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