Commit 1edf0547 authored by Richard Knoll's avatar Richard Knoll Committed by Commit Bot

NetworkService: Reset mojo pipe before dropping callbacks

The P2PSocketManager resolves host names in GetHostAddress and responds
with the supplied callback. That callback is dropped in the destructor
which can happen if there is a mojo connection error. We need to close
the pipe to the mojom::P2PSocketManager before doing that as mojo will
check if the connection is still active when dropping a callback.

Bug: None
Change-Id: I2a1e411f5aba21a375e33bd242b67f64c9362a8e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1991560Reviewed-by: default avatarSergey Ulanov <sergeyu@chromium.org>
Commit-Queue: Richard Knoll <knollr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#730125}
parent 1d40a24d
......@@ -167,6 +167,9 @@ P2PSocketManager::P2PSocketManager(
}
P2PSocketManager::~P2PSocketManager() {
// Reset the P2PSocketManager receiver before dropping pending dns requests.
socket_manager_receiver_.reset();
sockets_.clear();
dns_requests_.clear();
......
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