Skip to content

Commit 61cadc8

Browse files
committed
fix(linux): InitLinuxKeybord() memory leak bug
1 parent 44486f1 commit 61cadc8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/platform/linux/linux_keyboard.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,6 @@ static void LinuxKeybnoardThread(void *arg)
214214
int key;
215215
LCUI_TaskRec task = { 0 };
216216

217-
keyboard.active = TRUE;
218217
task.func = DispatchKeyboardEvent;
219218
task.destroy_arg[0] = free;
220219
while (keyboard.active) {
@@ -248,6 +247,7 @@ static int InitLinuxKeybord(void)
248247
for (; i < len; ++i) {
249248
signal(signals[i], on_signal);
250249
}
250+
keyboard.active = TRUE;
251251
LCUIThread_Create(&keyboard.tid, LinuxKeybnoardThread, NULL);
252252
Logger_Debug("[input] keyboard driver thread: %lld\n", keyboard.tid);
253253
return 0;

0 commit comments

Comments
 (0)