From e11a9383eef5b06346dabf10729dbd636063d9fe Mon Sep 17 00:00:00 2001 From: Djeeberjr Date: Wed, 31 May 2023 15:17:19 +0200 Subject: [PATCH] added callback dispose in ps handle --- src/kernel/ps/ProcessHandle.hx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/kernel/ps/ProcessHandle.hx b/src/kernel/ps/ProcessHandle.hx index 3a1e320..99cace2 100644 --- a/src/kernel/ps/ProcessHandle.hx +++ b/src/kernel/ps/ProcessHandle.hx @@ -20,6 +20,7 @@ class ProcessHandle { private final closeFuture: Future; private var closeFutureResolev: Bool -> Void; private final windowContexts: Array = []; + private final cbLinks:Array = []; @:allow(kernel.ps.ProcessManager) private function new(config: HandleConfig,pid: PID) { @@ -34,8 +35,6 @@ class ProcessHandle { if (this.config.onExit != null) { this.closeFuture.handle(this.config.onExit); } - - this.closeFuture.eager(); } public function onExit(): Future { @@ -75,7 +74,17 @@ class ProcessHandle { } private function dispose() { - // TODO + for (link in this.cbLinks) { + link.cancel(); + } + } + + public function getPid(): PID { + return this.pid; + } + + public function addCallbackLink(link: CallbackLink) { + this.cbLinks.push(link); } function get_args():ReadOnlyArray {