From 2791dc99efd604a437d1c079039f95157074cf32 Mon Sep 17 00:00:00 2001 From: xueshuming Date: Tue, 27 May 2025 15:45:03 +0800 Subject: [PATCH] Init Order: call 'mg_InitTimer' before call 'SystemThreads' --- src/kernel/init.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/kernel/init.c b/src/kernel/init.c index 6f189957..af462335 100644 --- a/src/kernel/init.c +++ b/src/kernel/init.c @@ -562,6 +562,13 @@ int GUIAPI InitGUI (int args, const char *agr[]) _is_minigui_running = 1; + /* init timer for tick counter */ + step++; + if (!mg_InitTimer()) { + _ERR_PRINTF ("KERNEL>InitGUI: failed to start time counter\n"); + goto failure; + } + step++; if (!SystemThreads()) { _ERR_PRINTF ("KERNEL>InitGUI: failed to init system threads!\n"); @@ -575,13 +582,6 @@ int GUIAPI InitGUI (int args, const char *agr[]) goto failure; } - /* init timer for tick counter */ - step++; - if (!mg_InitTimer()) { - _ERR_PRINTF ("KERNEL>InitGUI: failed to start time counter\n"); - goto failure; - } - SetKeyboardLayout ("default"); SetCursor (GetSystemCursor (IDC_ARROW));