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(); |
} |