VM terminates when initial isolate ends, even if other isolates are still running. #4229
Labels
area-core-library
SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.
core-l
P2
A bug or feature request we're likely to work on
type-enhancement
A request for a change that isn't a bug
Isolates should run and keep the VM open while they execute even if the parent idolate does not send a message or create a ReceivePort.
This sample only prints "test" when the ReceivePort is created. However, due to 3761, the Isolate then never terminates.
import('dart:io');
import('dart:isolate');
void main() {
ReceivePort receivePort = new ReceivePort(); // needed to keep the VM running
SendPort sendPort = spawnFunction(test);
}
void test() {
print("test");
}
This program doesn't print "test" or "hi" unless a ReceivePort is created in the parent Isolate.
void main() {
SendPort sendPort = spawnFunction(test);
sendPort.send("hi");
}
void test() {
port.receive((m, p) => print(m));
print("test");
}
The text was updated successfully, but these errors were encountered: