From b41dbbe9cf52e1807eda078c6d898085c73ecff7 Mon Sep 17 00:00:00 2001 From: Chris Michael Date: Wed, 10 Sep 2014 09:48:17 -0400 Subject: [PATCH] bugfix: When we free the pixmap, clear any user data set on the resource This was a cause of some memleaks/crashes in the wayland compositor because the compositor was trying to access properties of the E_Pixmap after it had already been freed. By setting the user_data to NULL, the functions in the compositor which were failing will now stop trying to access the pixmap after it's been freed. Signed-off-by: Chris Michael --- src/bin/e_pixmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/e_pixmap.c b/src/bin/e_pixmap.c index ed8552ec1..1ae242163 100644 --- a/src/bin/e_pixmap.c +++ b/src/bin/e_pixmap.c @@ -97,7 +97,7 @@ _e_pixmap_free(E_Pixmap *cp) break; case E_PIXMAP_TYPE_WL: #if defined(HAVE_WAYLAND_CLIENTS) || defined(HAVE_WAYLAND_ONLY) - /* NB: No-Op. Nothing to free. image data no longer memcpy'd */ + if (cp->resource) wl_resource_set_user_data(cp->resource, NULL); #endif break; default: