Index: mojo/public/cpp/bindings/lib/scoped_interface_endpoint_handle.cc |
diff --git a/mojo/public/cpp/bindings/lib/scoped_interface_endpoint_handle.cc b/mojo/public/cpp/bindings/lib/scoped_interface_endpoint_handle.cc |
index 4a2a47bcfb370a63de30b5b446545d8fe17001e4..6f30c9462184f9f43c1c07807d5d25bb7aa91652 100644 |
--- a/mojo/public/cpp/bindings/lib/scoped_interface_endpoint_handle.cc |
+++ b/mojo/public/cpp/bindings/lib/scoped_interface_endpoint_handle.cc |
@@ -35,12 +35,7 @@ ScopedInterfaceEndpointHandle::~ScopedInterfaceEndpointHandle() { |
ScopedInterfaceEndpointHandle& ScopedInterfaceEndpointHandle::operator=( |
ScopedInterfaceEndpointHandle&& other) { |
reset(); |
- |
- id_ = other.id_; |
- is_local_ = other.is_local_; |
- router_.swap(other.router_); |
- |
- other.id_ = kInvalidInterfaceId; |
+ swap(other); |
return *this; |
} |
@@ -52,6 +47,7 @@ void ScopedInterfaceEndpointHandle::reset() { |
router_->CloseEndpointHandle(id_, is_local_); |
id_ = kInvalidInterfaceId; |
+ is_local_ = true; |
router_ = nullptr; |
} |
@@ -66,6 +62,7 @@ InterfaceId ScopedInterfaceEndpointHandle::release() { |
InterfaceId result = id_; |
id_ = kInvalidInterfaceId; |
+ is_local_ = true; |
router_ = nullptr; |
return result; |