mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Fix global shutdown call from JSON API
This commit is contained in:
parent
5dbbe1ffd7
commit
8c9310f754
@ -248,7 +248,13 @@ JsonApiServer::JsonApiServer(): configMutex("JsonApiServer config"),
|
||||
{
|
||||
INITIALIZE_API_CALL_JSON_CONTEXT;
|
||||
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);
|
||||
|
||||
|
@ -397,8 +397,8 @@ int RsInit::InitRetroShare(const RsConfigOptions& conf)
|
||||
|
||||
#ifdef RS_JSONAPI
|
||||
// We create the JsonApiServer this early, because it is needed *before* login
|
||||
RsInfo() << __PRETTY_FUNCTION__
|
||||
<< "Allocating jsonAPI server (not launched yet)" << std::endl;
|
||||
RsDbg() << __PRETTY_FUNCTION__
|
||||
<< " Allocating JSON API server (not launched yet)" << std::endl;
|
||||
JsonApiServer* jas = new JsonApiServer();
|
||||
jas->setListeningPort(conf.jsonApiPort);
|
||||
jas->setBindingAddress(conf.jsonApiBindAddress);
|
||||
|
Loading…
Reference in New Issue
Block a user