From 4c7b798b45421fec9c54d95ef50ee685fdc07392 Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Thu, 19 Jul 2018 01:58:00 +0900 Subject: [PATCH] e wl - fix e pixmap tracking to remove from both aliases and pixmaps on pixmap free only the pixmaps entry was deleted not the pixmaps hash one. this led to lookup of stale pixmaps in the aliases hash... and then a crash. also use the correct local type with the correct byte order as well. this has probably been an issue for a while but now internal windows should work much better without crashes. @fix --- src/bin/e_pixmap.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/bin/e_pixmap.c b/src/bin/e_pixmap.c index b041e4cdd..5dfab0321 100644 --- a/src/bin/e_pixmap.c +++ b/src/bin/e_pixmap.c @@ -297,7 +297,28 @@ e_pixmap_free(E_Pixmap *cp) if (!cp) return 0; if (--cp->refcount) return cp->refcount; e_pixmap_image_clear(cp, EINA_FALSE); - eina_hash_del_by_key(pixmaps[cp->type], &cp->win); + switch (cp->type) + { + case E_PIXMAP_TYPE_X: +#ifndef HAVE_WAYLAND_ONLY + { + Ecore_X_Window xwin = cp->win; + eina_hash_del_by_key(pixmaps[cp->type], &xwin); + eina_hash_del_by_key(aliases[cp->type], &xwin); + } +#endif + break; + case E_PIXMAP_TYPE_WL: +#ifdef HAVE_WAYLAND + { + int64_t id = cp->win; + eina_hash_del_by_key(pixmaps[cp->type], &id); + eina_hash_del_by_key(aliases[cp->type], &id); + } +#endif + break; + default: break; + } return 0; }