mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-23 13:54:27 -04:00
Fix global shutdown call from JSON API
This commit is contained in:
parent
5dbbe1ffd7
commit
8c9310f754
2 changed files with 9 additions and 3 deletions
|
@ -248,7 +248,13 @@ JsonApiServer::JsonApiServer(): configMutex("JsonApiServer config"),
|
||||||
{
|
{
|
||||||
INITIALIZE_API_CALL_JSON_CONTEXT;
|
INITIALIZE_API_CALL_JSON_CONTEXT;
|
||||||
DEFAULT_API_CALL_JSON_RETURN(rb::OK);
|
DEFAULT_API_CALL_JSON_RETURN(rb::OK);
|
||||||
rsControl->rsGlobalShutDown();
|
|
||||||
|
/* Wrap inside RsThread::async because this call
|
||||||
|
* RsThread::fullstop() also on JSON API server thread.
|
||||||
|
* Calling RsThread::fullstop() from it's own thread should never
|
||||||
|
* happen and if it happens an error message is printed
|
||||||
|
* accordingly by RsThread::fullstop() */
|
||||||
|
RsThread::async([](){ rsControl->rsGlobalShutDown(); });
|
||||||
} );
|
} );
|
||||||
}, true);
|
}, true);
|
||||||
|
|
||||||
|
|
|
@ -397,8 +397,8 @@ int RsInit::InitRetroShare(const RsConfigOptions& conf)
|
||||||
|
|
||||||
#ifdef RS_JSONAPI
|
#ifdef RS_JSONAPI
|
||||||
// We create the JsonApiServer this early, because it is needed *before* login
|
// We create the JsonApiServer this early, because it is needed *before* login
|
||||||
RsInfo() << __PRETTY_FUNCTION__
|
RsDbg() << __PRETTY_FUNCTION__
|
||||||
<< "Allocating jsonAPI server (not launched yet)" << std::endl;
|
<< " Allocating JSON API server (not launched yet)" << std::endl;
|
||||||
JsonApiServer* jas = new JsonApiServer();
|
JsonApiServer* jas = new JsonApiServer();
|
||||||
jas->setListeningPort(conf.jsonApiPort);
|
jas->setListeningPort(conf.jsonApiPort);
|
||||||
jas->setBindingAddress(conf.jsonApiBindAddress);
|
jas->setBindingAddress(conf.jsonApiBindAddress);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue