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

Unified Diff: runtime/bin/process_macos.cc

Issue 2961993002: [dart:io] Fixes a crash in VM shutdown when signals are watched (Closed)
Patch Set: Fixes for Windows, comment Created 3 years, 6 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/bin/process_linux.cc ('k') | runtime/bin/process_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/process_macos.cc
diff --git a/runtime/bin/process_macos.cc b/runtime/bin/process_macos.cc
index 6c0d451712f5bf8f2a48b82a945c9ff00430ce89..582a8eae1ad14e4f1847ee9dc25038123aae2460 100644
--- a/runtime/bin/process_macos.cc
+++ b/runtime/bin/process_macos.cc
@@ -1076,7 +1076,10 @@ intptr_t Process::SetSignalHandler(intptr_t signal) {
}
-void Process::ClearSignalHandler(intptr_t signal) {
+void Process::ClearSignalHandler(intptr_t signal, Dart_Port port) {
+ // Either the port is illegal or there is no current isolate, but not both.
+ ASSERT((port != ILLEGAL_PORT) || (Dart_CurrentIsolate() == NULL));
+ ASSERT((port == ILLEGAL_PORT) || (Dart_CurrentIsolate() != NULL));
signal = SignalMap(signal);
if (signal == -1) {
return;
@@ -1088,7 +1091,7 @@ void Process::ClearSignalHandler(intptr_t signal) {
while (handler != NULL) {
bool remove = false;
if (handler->signal() == signal) {
- if (handler->port() == Dart_GetMainPortId()) {
+ if ((port == ILLEGAL_PORT) || (handler->port() == port)) {
if (signal_handlers == handler) {
signal_handlers = handler->next();
}
« no previous file with comments | « runtime/bin/process_linux.cc ('k') | runtime/bin/process_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698