summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2018-03-27 11:09:32 -0500
committerDerek Foreman <derekf@osg.samsung.com>2018-03-28 09:21:28 -0500
commitbef761796c2ada6344d227142af4a0f40b9760dd (patch)
treef6c95bad19360c8caff05bcd006a43570ffccb2f
parent77db9316ebd75c57c210417fd059a6d377047b56 (diff)
downloadweston-bef761796c2ada6344d227142af4a0f40b9760dd.tar.gz
xwm: Fix two more icon related memory leaks
Hopefully sort the last leaks introduced in commit 6b58ea8c The window could be destroyed before it had a frame but after it had an icon (I could trigger this with firefox), and the window could be assigned an icon twice before it had a frame (I could trigger this with terminology). The latter leak was Reported-by: Scott Moreau <oreaus@gmail.com> Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
-rw-r--r--xwayland/window-manager.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/xwayland/window-manager.c b/xwayland/window-manager.c
index dad117fa..7b98e140 100644
--- a/xwayland/window-manager.c
+++ b/xwayland/window-manager.c
@@ -1404,6 +1404,9 @@ weston_wm_handle_icon(struct weston_wm *wm, struct weston_wm_window *window)
return;
}
+ if (window->icon_surface)
+ cairo_surface_destroy(window->icon_surface);
+
cairo_surface_set_user_data(new_surface, NULL, reply,
&handle_icon_surface_destroy);
@@ -1506,6 +1509,8 @@ weston_wm_window_destroy(struct weston_wm_window *window)
wl_event_source_remove(window->repaint_source);
if (window->cairo_surface)
cairo_surface_destroy(window->cairo_surface);
+ if (window->icon_surface)
+ cairo_surface_destroy(window->icon_surface);
if (window->frame_id) {
xcb_reparent_window(wm->conn, window->id, wm->wm_window, 0, 0);