Index: mojo/edk/system/data_pipe_producer_dispatcher.cc |
diff --git a/mojo/edk/system/data_pipe_producer_dispatcher.cc b/mojo/edk/system/data_pipe_producer_dispatcher.cc |
index 27113eb945ad90da9a7509d7354a1b032d8f9860..9a8163a8e7cd703722f6052c757250e1e3f06e9f 100644 |
--- a/mojo/edk/system/data_pipe_producer_dispatcher.cc |
+++ b/mojo/edk/system/data_pipe_producer_dispatcher.cc |
@@ -86,8 +86,11 @@ DataPipeProducerDispatcher::DataPipeProducerDispatcher( |
} |
DataPipeProducerDispatcher::~DataPipeProducerDispatcher() { |
- // |Close()|/|CloseImplNoLock()| should have taken care of the channel. |
- DCHECK(!channel_); |
+ // See comment in ~MessagePipeDispatcher. |
+ if (channel_ && internal::g_io_thread_task_runner->RunsTasksOnCurrentThread()) |
+ channel_->Shutdown(); |
+ else |
+ DCHECK(!channel_); |
} |
void DataPipeProducerDispatcher::CancelAllAwakablesNoLock() { |