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

Unified Diff: mojo/edk/system/node_controller.cc

Issue 2784773002: Fix leaks in mojo::edk::NodeController (Closed)
Patch Set: Created 3 years, 9 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/node_controller.cc
diff --git a/mojo/edk/system/node_controller.cc b/mojo/edk/system/node_controller.cc
index cafd604d1cb36d78a017eee4edb3af5d3d4a33c6..9c8bb95e1de7a26a521cfa87d9448f6a0b17e0eb 100644
--- a/mojo/edk/system/node_controller.cc
+++ b/mojo/edk/system/node_controller.cc
@@ -712,6 +712,9 @@ void NodeController::SendPeerMessage(const ports::NodeName& name,
scoped_refptr<NodeChannel> broker = GetBrokerChannel();
if (!broker) {
DVLOG(1) << "Dropping message for unknown peer: " << name;
+
+ base::AutoLock lock(peers_lock_);
+ pending_peer_messages_.erase(name);
return;
}
broker->RequestIntroduction(name);
@@ -937,6 +940,16 @@ void NodeController::OnAcceptParent(const ports::NodeName& from_node,
return;
}
+ {
+ base::AutoLock lock(reserved_ports_lock_);
+ auto it = pending_child_tokens_.find(from_node);
+ if (it != pending_child_tokens_.end()) {
+ std::string token = std::move(it->second);
+ pending_child_tokens_.erase(it);
+ pending_child_tokens_[child_name] = std::move(token);
+ }
+ }
+
scoped_refptr<NodeChannel> channel = it->second;
pending_children_.erase(it);
@@ -1155,6 +1168,7 @@ void NodeController::OnRequestPortMerge(
return;
}
local_port = it->second.port;
+ reserved_ports_.erase(it);
}
int rv = node_->MergePorts(local_port, from_node, connector_port_name);
« 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