| Index: remoting/host/security_key/remote_security_key_message_reader_impl.cc
|
| diff --git a/remoting/host/security_key/remote_security_key_message_reader_impl.cc b/remoting/host/security_key/remote_security_key_message_reader_impl.cc
|
| index 2eb441856aa102ddf8b88b9201c03364a1ea223a..0431742ff77d8c2d8210b5bfbc3c91458ae39a22 100644
|
| --- a/remoting/host/security_key/remote_security_key_message_reader_impl.cc
|
| +++ b/remoting/host/security_key/remote_security_key_message_reader_impl.cc
|
| @@ -34,9 +34,8 @@ RemoteSecurityKeyMessageReaderImpl::RemoteSecurityKeyMessageReaderImpl(
|
| RemoteSecurityKeyMessageReaderImpl::~RemoteSecurityKeyMessageReaderImpl() {
|
| DCHECK(main_task_runner_->RunsTasksOnCurrentThread());
|
|
|
| - // In order to ensure the reader thread is stopped cleanly, we close the
|
| - // stream it is blocking on and then wait for the thread to exit.
|
| - read_stream_.Close();
|
| + // In order to ensure the reader thread is stopped cleanly, we want to stop
|
| + // the thread before the task runners and weak pointers are invalidated.
|
| reader_thread_.Stop();
|
| }
|
|
|
|
|