device: use an explicit type case 25/140225/2
authorSangjin Lee <lsj119@samsung.com>
Mon, 24 Jul 2017 07:22:15 +0000 (16:22 +0900)
committerSangjin Lee <lsj119@samsung.com>
Mon, 24 Jul 2017 08:14:41 +0000 (17:14 +0900)
Change-Id: If80f686b39d4c036aecbc0d63189d5c3cb0d1a7d

src/e_devicemgr_device.c

index 3751b0e67635d800c5272c0b7aae345336da1902..5b63a9c02aac352dac08b04e92290c9b2eff73b4 100644 (file)
@@ -705,7 +705,7 @@ static void
 _e_input_devmgr_request_client_add(struct wl_client *client, struct wl_resource *resource, uint32_t clas, uint32_t duration)
 {
    struct wl_listener *destroy_listener = NULL;
-   double milli_duration = duration / 1000;
+   double milli_duration = (double)(duration) / 1000.0;
 
    /* Last request of block can renew timer time */
    if (input_devmgr_data->duration_timer)
@@ -718,8 +718,16 @@ _e_input_devmgr_request_client_add(struct wl_client *client, struct wl_resource
    input_devmgr_data->block_client = client;
 
    destroy_listener = E_NEW(struct wl_listener, 1);
+   EINA_SAFETY_ON_NULL_GOTO(destroy_listener, failed);
    destroy_listener->notify = _e_input_devmgr_client_cb_destroy;
    wl_client_add_destroy_listener(client, destroy_listener);
+
+   return;
+
+failed:
+   ecore_timer_del(input_devmgr_data->duration_timer);
+   input_devmgr_data->duration_timer = NULL;
+   input_devmgr_data->block_client = NULL;
 }
 
 static void