added callback dispose in ps handle
This commit is contained in:
parent
182a2bce7d
commit
e11a9383ee
@ -20,6 +20,7 @@ class ProcessHandle {
|
|||||||
private final closeFuture: Future<Bool>;
|
private final closeFuture: Future<Bool>;
|
||||||
private var closeFutureResolev: Bool -> Void;
|
private var closeFutureResolev: Bool -> Void;
|
||||||
private final windowContexts: Array<WindowContext> = [];
|
private final windowContexts: Array<WindowContext> = [];
|
||||||
|
private final cbLinks:Array<CallbackLink> = [];
|
||||||
|
|
||||||
@:allow(kernel.ps.ProcessManager)
|
@:allow(kernel.ps.ProcessManager)
|
||||||
private function new(config: HandleConfig,pid: PID) {
|
private function new(config: HandleConfig,pid: PID) {
|
||||||
@ -34,8 +35,6 @@ class ProcessHandle {
|
|||||||
if (this.config.onExit != null) {
|
if (this.config.onExit != null) {
|
||||||
this.closeFuture.handle(this.config.onExit);
|
this.closeFuture.handle(this.config.onExit);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.closeFuture.eager();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onExit(): Future<Bool> {
|
public function onExit(): Future<Bool> {
|
||||||
@ -75,7 +74,17 @@ class ProcessHandle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private function dispose() {
|
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<String> {
|
function get_args():ReadOnlyArray<String> {
|
||||||
|
Loading…
Reference in New Issue
Block a user