e_comp_wl: close fd if it's allocated newly accepted/tizen/3.0/common/20170619.133508 accepted/tizen/3.0/ivi/20170619.075542 accepted/tizen/3.0/mobile/20170619.075529 accepted/tizen/3.0/tv/20170619.075534 accepted/tizen/3.0/wearable/20170619.075537 submit/tizen_3.0/20170619.034553
authorBoram Park <boram1288.park@samsung.com>
Mon, 19 Jun 2017 00:32:02 +0000 (09:32 +0900)
committerJuyeon Lee <juyeonne.lee@samsung.com>
Mon, 19 Jun 2017 03:45:18 +0000 (12:45 +0900)
Change-Id: Id80f461dec2ef71075a427fbe80c8573f9e7e5fe

src/bin/e_comp_wl_rsm.c

index a92ad627ef8cc73b4159d5a238dfd99a93688ffa..d1ab5a3c10cd56df749cbbc1d0a5f83e141df576 100644 (file)
@@ -621,6 +621,18 @@ _remote_surface_buff_send(E_Comp_Wl_Remote_Surface *rs)
 
         buff_type = TIZEN_REMOTE_SURFACE_BUFFER_TYPE_TBM;
         res = EINA_TRUE;
+
+        /* TODO: if client wants to receive image file for the remote_surfac_provider,
+         * then makes image file from tbm buffer and sends information for that file.
+         * otherwise, just sends tbm buffer to the client.
+         */
+        res = _remote_surface_changed_buff_protocol_send(rs,
+                                                         buff_type,
+                                                         rbuff,
+                                                         _rsm->dummy_fd,
+                                                         (unsigned int)img_size,
+                                                         EINA_FALSE,
+                                                         NULL);
      }
    else
      {
@@ -634,20 +646,21 @@ _remote_surface_buff_send(E_Comp_Wl_Remote_Surface *rs)
 
         buff_type = TIZEN_REMOTE_SURFACE_BUFFER_TYPE_IMAGE_FILE;
         res = EINA_TRUE;
+
+        /* TODO: if client wants to receive image file for the remote_surfac_provider,
+         * then makes image file from tbm buffer and sends information for that file.
+         * otherwise, just sends tbm buffer to the client.
+         */
+        res = _remote_surface_changed_buff_protocol_send(rs,
+                                                         buff_type,
+                                                         rbuff,
+                                                         fd,
+                                                         (unsigned int)img_size,
+                                                         EINA_FALSE,
+                                                         NULL);
+        close(fd);
      }
 
-   /* TODO: if client wants to receive image file for the remote_surfac_provider,
-    * then makes image file from tbm buffer and sends information for that file.
-    * otherwise, just sends tbm buffer to the client.
-    */
-   if (res)
-     res = _remote_surface_changed_buff_protocol_send(rs,
-                                                      buff_type,
-                                                      rbuff,
-                                                      fd,
-                                                      (unsigned int)img_size,
-                                                      EINA_FALSE,
-                                                      NULL);
 
    return res;