From ec00115216d9dba68f7b9d3059742c9d9d12eda7 Mon Sep 17 00:00:00 2001 From: Djeeberjr Date: Mon, 21 Feb 2022 17:46:38 +0100 Subject: [PATCH] default terminate action --- src/kernel/Init.hx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/kernel/Init.hx b/src/kernel/Init.hx index e117172..e877f6c 100644 --- a/src/kernel/Init.hx +++ b/src/kernel/Init.hx @@ -1,5 +1,6 @@ package kernel; +import cc.OS; import util.Debug; import kernel.ui.WindowManager; import kernel.peripherals.Peripherals.Peripheral; @@ -13,9 +14,14 @@ class Init { WindowManager.instance = new WindowManager(); MainTerm.instance = new MainTerm(); + Log.init(); Net.instance = new Net(); - Log.init(); + + // Register default terminate handler + KernelEvents.instance.onTerminate.handle(_->{ + OS.reboot(); + }); Debug.printBuildInfo(); }