Index: mojo/public/java/bindings/src/org/chromium/mojo/bindings/Connector.java |
diff --git a/mojo/public/java/bindings/src/org/chromium/mojo/bindings/Connector.java b/mojo/public/java/bindings/src/org/chromium/mojo/bindings/Connector.java |
index 17cc7ed9fe27e3d3d540a5edc792246a60f076ce..cc9f12ceb8d75134af4af02533ef5b8c735d7792 100644 |
--- a/mojo/public/java/bindings/src/org/chromium/mojo/bindings/Connector.java |
+++ b/mojo/public/java/bindings/src/org/chromium/mojo/bindings/Connector.java |
@@ -115,7 +115,11 @@ public class Connector implements MessageReceiver, HandleOwner<MessagePipeHandle |
@Override |
public MessagePipeHandle passHandle() { |
cancelIfActive(); |
- return mMessagePipeHandle.pass(); |
+ MessagePipeHandle handle = mMessagePipeHandle.pass(); |
+ if (mIncomingMessageReceiver != null) { |
+ mIncomingMessageReceiver.close(); |
+ } |
+ return handle; |
} |
/** |
@@ -125,6 +129,9 @@ public class Connector implements MessageReceiver, HandleOwner<MessagePipeHandle |
public void close() { |
cancelIfActive(); |
mMessagePipeHandle.close(); |
+ if (mIncomingMessageReceiver != null) { |
+ mIncomingMessageReceiver.close(); |
+ } |
} |
private class AsyncWaiterCallback implements AsyncWaiter.Callback { |