Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1360)

Unified Diff: mojo/edk/system/ports/node.cc

Issue 1985773002: [mojo-edk] Fix race in port closure (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@nohax
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698