Просмотр исходного кода

close no longer needed ReceivePort

devmil 4 лет назад
Родитель
Сommit
da7e0f97c3
1 измененных файлов с 1 добавлено и 0 удалено
  1. 1 0
      lib/terminal/terminal_isolate.dart

+ 1 - 0
lib/terminal/terminal_isolate.dart

@@ -342,6 +342,7 @@ class TerminalIsolate with Observable implements TerminalUiInteraction {
     var firstReceivePort = ReceivePort();
     var firstReceivePort = ReceivePort();
     _isolate = await Isolate.spawn(terminalMain, firstReceivePort.sendPort);
     _isolate = await Isolate.spawn(terminalMain, firstReceivePort.sendPort);
     _sendPort = await firstReceivePort.first;
     _sendPort = await firstReceivePort.first;
+    firstReceivePort.close();
     _sendPort!.send([_IsolateCommand.sendPort, _receivePort.sendPort]);
     _sendPort!.send([_IsolateCommand.sendPort, _receivePort.sendPort]);
     _receivePort.listen((message) {
     _receivePort.listen((message) {
       _IsolateEvent action = message[0];
       _IsolateEvent action = message[0];