| Index: mojo/edk/system/channel_win.cc
|
| diff --git a/mojo/edk/system/channel_win.cc b/mojo/edk/system/channel_win.cc
|
| index a834d977b47c902a41ddb5614d598e0b605bf331..c989344f62b0daf68d6b0153084898c9f9b2f7fd 100644
|
| --- a/mojo/edk/system/channel_win.cc
|
| +++ b/mojo/edk/system/channel_win.cc
|
| @@ -116,6 +116,11 @@ class ChannelWin : public Channel,
|
| }
|
| }
|
|
|
| + void LeakHandle() override {
|
| + DCHECK(io_task_runner_->RunsTasksOnCurrentThread());
|
| + leak_handle_ = true;
|
| + }
|
| +
|
| bool GetReadPlatformHandles(
|
| size_t num_handles,
|
| const void* extra_header,
|
| @@ -191,6 +196,8 @@ class ChannelWin : public Channel,
|
| // |handle_| should be valid at this point.
|
| CHECK(handle_.is_valid());
|
| CancelIo(handle_.get().handle);
|
| + if (leak_handle_)
|
| + ignore_result(handle_.release());
|
| handle_.reset();
|
|
|
| // May destroy the |this| if it was the last reference.
|
| @@ -332,6 +339,8 @@ class ChannelWin : public Channel,
|
|
|
| bool wait_for_connect_;
|
|
|
| + bool leak_handle_ = false;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(ChannelWin);
|
| };
|
|
|
|
|