nested: Remove the surface from the surface list when destroyed
authorNeil Roberts <neil@linux.intel.com>
Fri, 22 Nov 2013 15:41:53 +0000 (15:41 +0000)
committerKristian Høgsberg <krh@bitplanet.net>
Thu, 5 Dec 2013 00:34:07 +0000 (16:34 -0800)
Otherwise if the surface is destroyed then it will crash when it later
tries to render all of the surfaces. You can replicate this by doing
killall weston-nested-client while the example is running.

clients/nested.c

index ff59014..31618b2 100644 (file)
@@ -265,6 +265,8 @@ destroy_surface(struct wl_resource *resource)
 {
        struct nested_surface *surface = wl_resource_get_user_data(resource);
 
+       wl_list_remove(&surface->link);
+
        free(surface);
 }