Avoid freeing pixmap from unsetting parent window of pixmap
authorMinJeong Kim <minjjj.kim@samsung.com>
Fri, 6 Mar 2015 01:26:04 +0000 (10:26 +0900)
committerBoram Park <boram1288.park@samsung.com>
Wed, 18 Mar 2015 04:03:08 +0000 (13:03 +0900)
When some E_Client is deleted by hide event of its window,
comp_x tries to unset parent window of client's E_Pixmap.
This unsetting is causing freeing pixmap even if the pixmap is still pending.
this revision is for avoiding those unwanted free.

Change-Id: Id7568b57b4d274534915920c115ac59ae94e746e
Signed-off-by: MinJeong Kim <minjjj.kim@samsung.com>
src/bin/e_pixmap.c

index 7ea6728243f179f34ff76141e0c7d4f2ae37c06a..a53aa6806c12fcd92c07f2f54b7c57ace16aecc7 100644 (file)
@@ -264,8 +264,22 @@ e_pixmap_parent_window_set(E_Pixmap *cp, Ecore_Window win)
    EINA_SAFETY_ON_NULL_RETURN(cp);
    if (cp->parent == win) return;
 
-   e_pixmap_usable_set(cp, 0);
-   e_pixmap_clear(cp);
+   switch (cp->type)
+     {
+      case E_PIXMAP_TYPE_X:
+#ifndef HAVE_WAYLAND_ONLY
+         e_pixmap_usable_set(cp, 0);
+         if (win) e_pixmap_clear(cp);
+         else ecore_x_e_comp_pixmap_set(cp->parent, 0);
+#endif
+         break;
+      case E_PIXMAP_TYPE_WL:
+#if defined(HAVE_WAYLAND_CLIENTS) || defined(HAVE_WAYLAND_ONLY)
+         e_pixmap_usable_set(cp, 0);
+         e_pixmap_clear(cp);
+#endif
+         break;
+     }
 
    if (cp->parent)
      eina_hash_set(pixmaps[cp->type], &cp->parent, NULL);