ico-input.mgr: avoid crashes in case the assigned app were not running 21/15321/1 submit/tizen/20140128.054041
authorJanos Kovacs <jankovac503@gmail.com>
Sat, 18 Jan 2014 13:11:38 +0000 (15:11 +0200)
committerJanos Kovacs <jankovac503@gmail.com>
Sat, 18 Jan 2014 13:57:19 +0000 (15:57 +0200)
If system-controller directs some input to an application that
does not run and the input state changed, weston crashes in
        ico_device_input_event() routine. This patch fixes this problem
        by avoiding to deliver input state changes to applications that
did not run or have not registered yet a proxy.

Change-Id: I87405ad91a0149180675fd512d54b413a4907409
Signed-off-by: Janos Kovacs <jankovac503@gmail.com>
src/ico_input_mgr.c

index b24fbed..0ff284b 100644 (file)
@@ -1441,6 +1441,14 @@ ico_device_input_event(struct wl_client *client, struct wl_resource *resource,
         return;
     }
 
+    if (! pInput->app->resource) {
+        uifw_trace("ico_device_input_event: Leave(%s.%s assigned App.%s "
+                   "is not running or not interested)",
+                   pIctlMgr->device, pInput->swname, pInput->app->appid);
+        return;
+    }
+
+
     /* send event to application        */
     uifw_trace("ico_device_input_event: send event=%s.%s[%d],%d,%d to App.%s",
                pIctlMgr->device, pInput->swname, input, code, state, pInput->app->appid);