e_input_evdev: Fix crash occured no touch device is attached 40/300440/1
authorJihoon Kim <jihoon48.kim@samsung.com>
Tue, 24 Oct 2023 11:33:37 +0000 (20:33 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Wed, 25 Oct 2023 05:20:05 +0000 (14:20 +0900)
Change-Id: Ic5ed30e3665a0aaeb06cc8c5d54be18f172fd5a0
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
src/bin/e_input_evdev.c

index 56109ca..4ffa019 100644 (file)
@@ -2309,6 +2309,9 @@ _e_input_evdev_device_create(E_Input_Seat *seat, struct libinput_device *device)
    edev->device = device;
    edev->path = eina_stringshare_printf("%s/%s", e_input_base_dir_get(), libinput_device_get_sysname(device));
 
+   g_mutex_init(&edev->touch.raw_pressed_mutex);
+   g_mutex_init(&edev->touch.blocked_mutex);
+
    if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_KEYBOARD))
      {
         edev->caps |= E_INPUT_SEAT_KEYBOARD;
@@ -2346,8 +2349,6 @@ _e_input_evdev_device_create(E_Input_Seat *seat, struct libinput_device *device)
 
         _device_touch_count_update(edev);
 
-        g_mutex_init(&edev->touch.raw_pressed_mutex);
-        g_mutex_init(&edev->touch.blocked_mutex);
         edev->touch.coords = calloc(1, sizeof(E_Input_Coord)*e_input_touch_max_count_get());
 
         if  (!edev->touch.coords)