Index: mojo/edk/system/ports/node.cc |
diff --git a/mojo/edk/system/ports/node.cc b/mojo/edk/system/ports/node.cc |
index 1bee00caf1ff3bab8524d578fbe353bd89764316..5a5d83454197d0118c13a7d46ef138e709fde9fb 100644 |
--- a/mojo/edk/system/ports/node.cc |
+++ b/mojo/edk/system/ports/node.cc |
@@ -213,13 +213,13 @@ int Node::ClosePort(const PortRef& port_ref) { |
// If the port being closed still has unread messages, then we need to take |
// care to close those ports so as to avoid leaking memory. |
port->message_queue.GetReferencedPorts(&referenced_port_names); |
+ |
+ ErasePort_Locked(port_ref.name()); |
} |
DVLOG(2) << "Sending ObserveClosure from " << port_ref.name() << "@" << name_ |
<< " to " << peer_port_name << "@" << peer_node_name; |
- ErasePort(port_ref.name()); |
- |
delegate_->ForwardMessage( |
peer_node_name, |
NewInternalMessage(peer_port_name, EventType::kObserveClosure, data)); |