API improvement & bug fix:

- subscribed global event doesnt unsubcribed when process is killed
- process killall API doesnt work as expected
- improve core API
This commit is contained in:
Dany LE
2021-11-25 01:13:16 +01:00
parent 64094c29d5
commit 0624f421f7
6 changed files with 90 additions and 119 deletions

View File

@ -63,6 +63,10 @@ namespace OS {
obj.birth = new Date().getTime();
PM.pidalloc++;
obj.pid = PM.pidalloc;
obj.subscribe("systemlocalechange", (d) => {
obj.updateLocale(d.message as string);
return obj.update();
});
PM.processes[app].push(obj);
if (metaclass.type === ModelType.Application) {
GUI.dock(
@ -149,7 +153,11 @@ namespace OS {
if (!PM.processes[app]) {
return;
}
PM.processes[app].map((a) => a.quit(force));
const arr = PM.processes[app].map( e => e);
for(const p of arr)
{
p.quit(force);
}
}
}
}