elm_cnp: skip other process's send/receive event
authorTaehyub Kim <taehyub.kim@samsung.com>
Thu, 24 Nov 2016 06:37:52 +0000 (15:37 +0900)
committerTaehyub Kim <taehyub.kim@samsung.com>
Tue, 29 Nov 2016 12:32:35 +0000 (21:32 +0900)
when ECORE_WL_EVENT_SELECTION_DATA_READY and ECORE_WL_EVENT_SELECTION_SOURCE_SEND callbacks
are added by other packages, matched event callbacks in elm_cnp can be called in unexpected time.

Change-Id: I6248b697a2e873814a940f51373f72bb40cb1f4b

src/lib/elm_cnp.c

index 98a76363d6566aadee9701cc6dcd4a0b9a10f239..8313aaef5fbd837e09ec3878213479679285a057 100644 (file)
@@ -3233,6 +3233,11 @@ _wl_selection_send(void *data, int type EINA_UNUSED, void *event)
    buf = data_ret;
    cnp_debug("write: %s", buf);
 
+   //TIZEN_ONLY(20161124): skip other process's send event
+   if (buf == NULL)
+     return ECORE_CALLBACK_PASS_ON;
+   //
+
    while (len_written < len_ret)
      {
         ret = write(ev->fd, buf, len_remained);
@@ -3244,6 +3249,12 @@ _wl_selection_send(void *data, int type EINA_UNUSED, void *event)
    free(data_ret);
 
    close(ev->fd);
+
+   //TIZEN_ONLY(20161124): skip other process's send event
+   ELM_SAFE_FREE(sel->selbuf, free);
+   sel->buflen = 0;
+   //
+
    return ECORE_CALLBACK_PASS_ON;
 }
 
@@ -3393,6 +3404,10 @@ end:
         /* FIXME: Send Finished ?? */
      }
 
+   //TIZEN_ONLY(20161124): skip other process's receive event
+   sel->requestwidget = NULL;
+   //
+
    return ECORE_CALLBACK_PASS_ON;
 }
 //