Commit c3fe90d8 authored by Dan Melnic's avatar Dan Melnic Committed by Facebook GitHub Bot

Avoid dereferencing a nullptr socket_

Summary: Avoid dereferencing a nullptr socket_

Reviewed By: danobi

Differential Revision: D24652875

fbshipit-source-id: 63a9535226c8ff58fd5348f3c38f5c6c498d9527
parent bd529c4c
...@@ -208,9 +208,11 @@ class UDPClient : private AsyncUDPSocket::ReadCallback, private AsyncTimeout { ...@@ -208,9 +208,11 @@ class UDPClient : private AsyncUDPSocket::ReadCallback, private AsyncTimeout {
void shutdown() { void shutdown() {
CHECK(evb_->isInEventBaseThread()); CHECK(evb_->isInEventBaseThread());
socket_->pauseRead(); if (socket_) {
socket_->close(); socket_->pauseRead();
socket_.reset(); socket_->close();
socket_.reset();
}
evb_->terminateLoopSoon(); evb_->terminateLoopSoon();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment