Commit bef76179 authored by Derek Foreman's avatar Derek Foreman

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's avatarScott Moreau <>
Signed-off-by: default avatarDerek Foreman <>
Reviewed-by: Pekka Paalanen's avatarPekka Paalanen <>
parent 77db9316
......@@ -1404,6 +1404,9 @@ weston_wm_handle_icon(struct weston_wm *wm, struct weston_wm_window *window)
if (window->icon_surface)
cairo_surface_set_user_data(new_surface, NULL, reply,
......@@ -1506,6 +1509,8 @@ weston_wm_window_destroy(struct weston_wm_window *window)
if (window->cairo_surface)
if (window->icon_surface)
if (window->frame_id) {
xcb_reparent_window(wm->conn, window->id, wm->wm_window, 0, 0);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment