From 1b3b355fea3a2ec31dc3609580d83dc4ffbe3df2 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Mon, 25 Aug 2014 16:11:25 -0700 Subject: [PATCH] Invoke trapexit after removing the pid, in case of exn in the trapexit fn --- src/minimart.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/minimart.js b/src/minimart.js index eb8192a..973349e 100644 --- a/src/minimart.js +++ b/src/minimart.js @@ -179,11 +179,11 @@ World.prototype.kill = function (pid, exn) { console.log("Process exited", pid, exn); } var p = this.processTable[pid]; - if (p && p.behavior.trapexit) { - this.asChild(pid, function () { return p.behavior.trapexit(exn); }); - } delete this.processTable[pid]; if (p) { + if (p.behavior.trapexit) { + this.asChild(pid, function () { return p.behavior.trapexit(exn); }, true); + } if (exn) { p.exitReason = exn; this.tombstones[pid] = p;