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

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

Issue 2780433003: 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 7bdb571c88c7a2c5857a3a9ae494c85366fe65d7..982ca39d02b77a94bd94dbc0da307d473c0367dd 100644
--- a/mojo/edk/system/node_controller.cc
+++ b/mojo/edk/system/node_controller.cc
@@ -710,6 +710,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);
@@ -935,6 +938,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