e_xdg_shell_v6: check null for shell resources 17/191917/2
authorJuyeon Lee <juyeonne.lee@samsung.com>
Thu, 25 Oct 2018 08:54:01 +0000 (17:54 +0900)
committerGwanglim Lee <gl77.lee@samsung.com>
Thu, 25 Oct 2018 09:37:07 +0000 (09:37 +0000)
sometimes, zxdg shell destroy is made at the same time of conifugration changes
   zxdg_toplevel_v6_destroy() --> To destroy zxdg_toplevel_v6 resource.
   tizen_policy_lower()  --> to generate configure event from enlightenment

Change-Id: I0e2a960313da4a78d181c8878b8fa6e5985455d4

src/bin/e_xdg_shell_v6.c

index 3de0947199debdc1e8863db0a7aa9c84beab60b7..aeb78c46c6566b1657f7a7ba45bea50083fcf9bc 100644 (file)
@@ -237,6 +237,9 @@ _e_xdg_popup_committed(E_Xdg_Popup *popup)
 static void
 _e_xdg_popup_configure_send(E_Xdg_Popup *popup)
 {
+   if (!popup) return;
+   if (!popup->resource) return;
+
    zxdg_popup_v6_send_configure(popup->resource,
                                 popup->geometry.x,
                                 popup->geometry.y,
@@ -309,6 +312,12 @@ _e_xdg_toplevel_committed(E_Xdg_Toplevel *toplevel)
         return;
      }
 
+   if (!toplevel->resource)
+     {
+        ERR("E_Client must have xdg_toplevel instance", ec->pixmap, ec);
+        return;
+     }
+
    if (!e_pixmap_usable_get(ec->pixmap))
      {
         ERR("E_Pixmap should be valid here", ec->pixmap, ec);
@@ -371,6 +380,8 @@ _e_xdg_toplevel_configure_send(E_Xdg_Toplevel *toplevel,
    uint32_t *s;
    struct wl_array states;
 
+   if (!toplevel->resource) return;
+
    configure->state = toplevel->pending.state;
    configure->size = toplevel->pending.size;
 
@@ -1078,6 +1089,7 @@ _e_xdg_surface_cb_configure_send(void *data)
    EINA_SAFETY_ON_NULL_GOTO(exsurf, end);
    EINA_SAFETY_ON_NULL_GOTO(exsurf->ec, end);
    EINA_SAFETY_ON_NULL_GOTO(exsurf->ec->comp_data, end);
+   EINA_SAFETY_ON_NULL_GOTO(exsurf->resource, end);
 
    if (e_object_is_del(E_OBJECT(exsurf->ec)))
      goto end;
@@ -1734,6 +1746,7 @@ static void
 _e_xdg_shell_ping(E_Xdg_Shell *shell)
 {
    EINA_SAFETY_ON_NULL_RETURN(shell);
+   EINA_SAFETY_ON_NULL_RETURN(shell->resource);
 
    if (shell->ping_serial != 0)
      return;