e_devicemgr: Do not send device_remove event if no object found by id in client's map 80/313380/1
authorduna.oh <duna.oh@samsung.com>
Mon, 24 Jun 2024 12:56:58 +0000 (21:56 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Tue, 25 Jun 2024 05:16:05 +0000 (14:16 +0900)
Change-Id: I23d6679f88d760290a26e97af95ddf81619ea185

src/bin/server/e_devicemgr_wl.c

index ce49165..4e6bbdc 100644 (file)
@@ -189,7 +189,8 @@ void
 e_devicemgr_wl_device_del(E_Devicemgr_Input_Device *dev)
 {
    struct wl_resource *res;
-   uint32_t serial;
+   struct wl_client *wc;
+   uint32_t serial, res_id;
    E_Tizen_Devicemgr_User_Data *device_user_data;
 
    serial = wl_display_next_serial(e_comp_wl->wl.disp);
@@ -197,11 +198,24 @@ e_devicemgr_wl_device_del(E_Devicemgr_Input_Device *dev)
    EINA_LIST_FREE(dev->resources, res)
      {
         device_user_data = wl_resource_get_user_data(res);
+
         if (!device_user_data) continue;
         if (!device_user_data->dev_mgr_res || !device_user_data->seat_res ||
             !device_user_data->dev_res)
           continue;
 
+        res_id = wl_resource_get_id(res);
+        wc = wl_resource_get_client(res);
+        if (wl_client_get_object(wc, res_id) != res)
+          {
+             pid_t pid;
+             wl_client_get_credentials(wc, &pid, NULL, NULL);
+
+             DMERR("No device_remove sent: PID@%d id@%u path:%s",
+                   pid, res_id, dev->identifier);
+             continue;
+          }
+
         device_user_data->dev = NULL;
         tizen_input_device_manager_send_device_remove(
                                    device_user_data->dev_mgr_res,