Destroy DNS resolver of HttpClient in the correct thread (#490)
This commit is contained in:
parent
3424d3f2c4
commit
ccd51d289e
|
@ -192,6 +192,11 @@ HttpClientImpl::HttpClientImpl(trantor::EventLoop *loop,
|
|||
HttpClientImpl::~HttpClientImpl()
|
||||
{
|
||||
LOG_TRACE << "Deconstruction HttpClient";
|
||||
if (resolverPtr_ && !(loop_->isInLoopThread()))
|
||||
{
|
||||
// Make sure the resolverPtr_ is destroyed in the correct thread.
|
||||
loop_->queueInLoop([reolverPtr = resolverPtr_]() {});
|
||||
}
|
||||
}
|
||||
|
||||
void HttpClientImpl::sendRequest(const drogon::HttpRequestPtr &req,
|
||||
|
|
Loading…
Reference in New Issue