| Index: mojo/public/cpp/bindings/lib/binding_state.h
|
| diff --git a/mojo/public/cpp/bindings/lib/binding_state.h b/mojo/public/cpp/bindings/lib/binding_state.h
|
| index 77a59f5d0edb8cafe95d0be46d0a6124a7e1b45f..4f4185a515c39debcce02079cdeaa4407648a443 100644
|
| --- a/mojo/public/cpp/bindings/lib/binding_state.h
|
| +++ b/mojo/public/cpp/bindings/lib/binding_state.h
|
| @@ -44,10 +44,7 @@ class BindingState<Interface, false> {
|
| stub_.set_sink(impl_);
|
| }
|
|
|
| - ~BindingState() {
|
| - if (router_)
|
| - Close();
|
| - }
|
| + ~BindingState() { Close(); }
|
|
|
| void Bind(ScopedMessagePipeHandle handle,
|
| scoped_refptr<base::SingleThreadTaskRunner> runner) {
|
| @@ -82,7 +79,9 @@ class BindingState<Interface, false> {
|
| }
|
|
|
| void Close() {
|
| - DCHECK(router_);
|
| + if (!router_)
|
| + return;
|
| +
|
| router_->CloseMessagePipe();
|
| DestroyRouter();
|
| }
|
| @@ -140,10 +139,7 @@ class BindingState<Interface, true> {
|
| stub_.set_sink(impl_);
|
| }
|
|
|
| - ~BindingState() {
|
| - if (router_)
|
| - Close();
|
| - }
|
| + ~BindingState() { Close(); }
|
|
|
| void Bind(ScopedMessagePipeHandle handle,
|
| scoped_refptr<base::SingleThreadTaskRunner> runner) {
|
| @@ -181,7 +177,9 @@ class BindingState<Interface, true> {
|
| }
|
|
|
| void Close() {
|
| - DCHECK(router_);
|
| + if (!router_)
|
| + return;
|
| +
|
| endpoint_client_.reset();
|
| router_->CloseMessagePipe();
|
| router_ = nullptr;
|
|
|