elm_win: fix potentially crash when accessing wl_surface before show for elm_win. 36/59836/1
authorSeunghun Lee <shiin.lee@samsung.com>
Fri, 19 Feb 2016 02:36:12 +0000 (11:36 +0900)
committerSeunghun Lee <shiin.lee@samsung.com>
Fri, 19 Feb 2016 02:41:42 +0000 (11:41 +0900)
since wl_surface is only valid after make elm_win to show,
if calling ecore_wl_window API befor show will be failed,
and will cause crash by accessing null wl_surface.

Change-Id: I668ce9e1cbcb27c3571950f78e37369c60c3be8d

src/lib/elm_win.c

index 5fd22d1..4defc61 100644 (file)
@@ -2083,13 +2083,13 @@ _elm_win_obj_intercept_show(void *data,
 #endif
         evas_object_show(sd->pointer.obj);
      }
+   evas_object_show(obj);
 #ifdef HAVE_ELEMENTARY_WAYLAND
    int x, y, w, h;
 
    evas_object_geometry_get(obj, &x, &y, &w, &h);
    ecore_wl_window_opaque_region_set(sd->wl.win, x, y, w, h);
 #endif
-   evas_object_show(obj);
 #ifdef ELEMENTARY_X
    if (sd->type == ELM_WIN_TOOLTIP)
      ecore_x_window_shape_input_rectangle_set(sd->x.xwin, 0, 0, 0, 0);