fixed shutdown callback issue in retroshare-service.cc

This commit is contained in:
csoler 2019-08-30 22:09:47 +02:00
parent 1bf07f72c4
commit b4bfdf2e25
No known key found for this signature in database
GPG Key ID: 7BCA522266C0804C
2 changed files with 5 additions and 3 deletions

View File

@ -22,7 +22,6 @@
/// RetroShare initialization and login API implementation
#include <unistd.h>
#include <math.h>
#include <termios.h>
#ifndef WINDOWS_SYS

View File

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