Revert "xwm: Fix memory leak"
authorPekka Paalanen <pekka.paalanen@collabora.co.uk>
Tue, 20 Mar 2018 08:12:37 +0000 (10:12 +0200)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Tue, 20 Mar 2018 08:14:11 +0000 (10:14 +0200)
This reverts commit d2cb711d813e750b1e303e6200c027fd27a21f8e.

I missed the call to cairo_image_surface_create_for_data() which assumes
the data will remain present until the cairo surface is destroyed. It
seems the existence of data depends on the reply not being freed.

This will need a more involved fix.

Sorry, I noticed this just seconds after I pushed the patch.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
xwayland/window-manager.c

index 24e7213..c307e19 100644 (file)
@@ -1387,8 +1387,6 @@ weston_wm_handle_icon(struct weston_wm *wm, struct weston_wm_window *window)
                                                    CAIRO_FORMAT_ARGB32,
                                                    width, height, width * 4);
 
-       free(reply);
-
        /* Bail out in case anything wrong happened during surface creation. */
        if (cairo_surface_status(new_surface) != CAIRO_STATUS_SUCCESS) {
                cairo_surface_destroy(new_surface);