Commit to having onStop shutdownActions run in parent facet context
This commit is contained in:
parent
364c97f357
commit
951598b7d0
|
@ -199,7 +199,11 @@ export class Facet {
|
|||
|
||||
Turn.active._inFacet(this, () => {
|
||||
this.children.forEach(child => child._terminate(orderly));
|
||||
if (orderly) this.shutdownActions.forEach(a => a());
|
||||
if (orderly) {
|
||||
Turn.active._inFacet(parent ?? this, () => {
|
||||
this.shutdownActions.forEach(a => a());
|
||||
});
|
||||
}
|
||||
this.outbound.forEach(e => Turn.active._retract(e));
|
||||
|
||||
if (orderly) {
|
||||
|
@ -315,9 +319,7 @@ export class Turn {
|
|||
this.stopActor();
|
||||
} else {
|
||||
this.enqueue(facet, () => {
|
||||
if (continuation) {
|
||||
facet.onStop(() => Turn.active._inFacet(facetParent, continuation));
|
||||
}
|
||||
if (continuation) facet.onStop(continuation);
|
||||
facet._terminate(true);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue