desktop: Remove the surface in all cases 46/23746/1
authorMarius Vlad <marius.vlad@collabora.com>
Wed, 5 Feb 2020 20:00:25 +0000 (22:00 +0200)
committerMarius Vlad <marius.vlad@collabora.com>
Thu, 6 Feb 2020 11:40:11 +0000 (13:40 +0200)
It could happen that the surface was never switched to and maybe is not
longer available when we try to search in the surfaces list. Avoids the
case where retrieving the app_id name from a desktop surface no longer
active causes a memory violation.

Bug-AGL: SPEC-3160

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I0473dc0745bcf4d8bdc55f7ca6b7bc3bb8069a8f

src/desktop.c

index 26569d6..8c6437d 100644 (file)
@@ -119,9 +119,9 @@ desktop_surface_removed(struct weston_desktop_surface *dsurface, void *userdata)
        if (weston_surface_is_mapped(wsurface)) {
                weston_desktop_surface_unlink_view(surface->view);
                weston_view_destroy(surface->view);
-               wl_list_remove(&surface->link);
        }
 
+       wl_list_remove(&surface->link);
        free(surface);
 }