mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-29 16:47:25 -04:00
fixed shutdown callback issue in retroshare-service.cc
This commit is contained in:
parent
1bf07f72c4
commit
b4bfdf2e25
2 changed files with 5 additions and 3 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue