Fix crash when subprocess was not spawned by eventcore

This commit is contained in:
Benjamin Schaaf 2019-07-22 10:55:45 +10:00
parent a8cd897df7
commit 4d71b62507

View file

@ -295,7 +295,7 @@ final class SignalEventDriverProcesses(Loop : PosixEventLoop) : EventDriverProce
// thread. // thread.
if (() @trusted { return cast(void*)this == cast(void*)driver; } ()) { if (() @trusted { return cast(void*)this == cast(void*)driver; } ()) {
onLocalProcessExit(cast(intptr_t)pid); onLocalProcessExit(cast(intptr_t)pid);
} else { } else if (driver) {
auto sharedDriver = () @trusted { return cast(shared typeof(this))driver; } (); auto sharedDriver = () @trusted { return cast(shared typeof(this))driver; } ();
sharedDriver.m_driver.core.runInOwnerThread(&onLocalProcessExit, cast(intptr_t)pid); sharedDriver.m_driver.core.runInOwnerThread(&onLocalProcessExit, cast(intptr_t)pid);