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

Unified Diff: runtime/vm/port.cc

Issue 2217693002: Delete NativeMessageHandler once a native port closes. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: edits Created 4 years, 4 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 | « runtime/vm/native_message_handler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/port.cc
diff --git a/runtime/vm/port.cc b/runtime/vm/port.cc
index 2541b38079e10746ef0eadfddee18fb6a2380716..d5513d598ac2c984a3751775d3dbd0fced91f909 100644
--- a/runtime/vm/port.cc
+++ b/runtime/vm/port.cc
@@ -216,7 +216,8 @@ bool PortMap::ClosePort(Dart_Port port) {
}
handler->ClosePort(port);
if (!handler->HasLivePorts() && handler->OwnedByPortMap()) {
- delete handler;
+ // Delete handler as soon as it isn't busy with a task.
+ handler->RequestDeletion();
}
return true;
}
« no previous file with comments | « runtime/vm/native_message_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698