| Index: mojo/public/cpp/bindings/lib/multiplex_router.cc
|
| diff --git a/mojo/public/cpp/bindings/lib/multiplex_router.cc b/mojo/public/cpp/bindings/lib/multiplex_router.cc
|
| index 5602b2a0591e6d9fc26f2f386bad76f3dab823d0..14ea64740756a9377829c23512a2eb1b7b457603 100644
|
| --- a/mojo/public/cpp/bindings/lib/multiplex_router.cc
|
| +++ b/mojo/public/cpp/bindings/lib/multiplex_router.cc
|
| @@ -335,8 +335,16 @@ MultiplexRouter::~MultiplexRouter() {
|
| // because it may remove the corresponding value from the map.
|
| ++iter;
|
|
|
| - DCHECK(endpoint->closed());
|
| - UpdateEndpointStateMayRemove(endpoint, PEER_ENDPOINT_CLOSED);
|
| + if (!endpoint->closed()) {
|
| + // This happens when a NotifyPeerEndpointClosed message been received, but
|
| + // (1) the interface ID hasn't been used to create local endpoint handle;
|
| + // and (2) a NotifyEndpointClosedBeforeSent hasn't been received.
|
| + DCHECK(!endpoint->client());
|
| + DCHECK(endpoint->peer_closed());
|
| + UpdateEndpointStateMayRemove(endpoint, ENDPOINT_CLOSED);
|
| + } else {
|
| + UpdateEndpointStateMayRemove(endpoint, PEER_ENDPOINT_CLOSED);
|
| + }
|
| }
|
|
|
| DCHECK(endpoints_.empty());
|
|
|