mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
fixed shutdown callback issue in retroshare-service.cc
This commit is contained in:
parent
1bf07f72c4
commit
b4bfdf2e25
@ -22,7 +22,6 @@
|
||||
/// RetroShare initialization and login API implementation
|
||||
|
||||
#include <unistd.h>
|
||||
#include <math.h>
|
||||
#include <termios.h>
|
||||
|
||||
#ifndef WINDOWS_SYS
|
||||
|
@ -284,8 +284,11 @@ int main(int argc, char* argv[])
|
||||
if(jsonApiServer)
|
||||
jsonApiServer->authorizeToken("webui:"+webui_pass1);
|
||||
|
||||
while(true)
|
||||
sleep(1);
|
||||
std::atomic<bool> keepRunning = true;
|
||||
rsControl->setShutdownCallback([&](int){keepRunning = false;});
|
||||
|
||||
while(keepRunning)
|
||||
std::this_thread::sleep_for(std::chrono::seconds(5));
|
||||
#endif
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user