Mercurial > hg > orthanc-stone
diff Platforms/Generic/WebServiceCommandBase.cpp @ 377:8eb4fe74000f
refactoring
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 05 Nov 2018 16:18:27 +0100 |
parents | 14ef1227120f |
children | aee3d7941c9b |
line wrap: on
line diff
--- a/Platforms/Generic/WebServiceCommandBase.cpp Mon Nov 05 13:25:03 2018 +0100 +++ b/Platforms/Generic/WebServiceCommandBase.cpp Mon Nov 05 16:18:27 2018 +0100 @@ -49,17 +49,20 @@ void WebServiceCommandBase::Commit() { - NativeStoneApplicationContext::GlobalMutexLocker lock(context_); // we want to make sure that, i.e, the UpdateThread is not triggered while we are updating the "model" with the result of a WebServiceCommand + // We want to make sure that, i.e, the UpdateThread is not + // triggered while we are updating the "model" with the result of + // a WebServiceCommand + NativeStoneApplicationContext::GlobalMutexLocker lock(context_); if (success_ && successCallback_.get() != NULL) { - successCallback_->Apply(IWebService::HttpRequestSuccessMessage(uri_, answer_.c_str(), answer_.size(), payload_.release())); + IWebService::HttpRequestSuccessMessage message(uri_, answer_.c_str(), answer_.size(), payload_.get()); + successCallback_->Apply(message); } else if (!success_ && failureCallback_.get() != NULL) { - failureCallback_->Apply(IWebService::HttpRequestErrorMessage(uri_, payload_.release())); + IWebService::HttpRequestErrorMessage message(uri_, payload_.get()); + failureCallback_->Apply(message); } - } - }