main: correctly remove all displays on uterm-video shutdown
authorDavid Herrmann <dh.herrmann@googlemail.com>
Wed, 28 Nov 2012 21:16:07 +0000 (22:16 +0100)
committerDavid Herrmann <dh.herrmann@googlemail.com>
Wed, 28 Nov 2012 21:16:07 +0000 (22:16 +0100)
If we close an uterm-video object, we must correctly remove all displays
first.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
src/kmscon_main.c

index c1d73bd..b02d6bd 100644 (file)
@@ -350,10 +350,19 @@ err_free:
 
 static void app_seat_remove_video(struct app_seat *seat, struct app_video *vid)
 {
+       struct uterm_display *disp;
+
        log_debug("free video device %s on seat %s", vid->node, seat->name);
 
        shl_dlist_unlink(&vid->list);
        uterm_video_unregister_cb(vid->video, app_seat_video_event, vid);
+
+       disp = uterm_video_get_displays(vid->video);
+       while (disp) {
+               kmscon_seat_remove_display(seat->seat, disp);
+               disp = uterm_display_next(disp);
+       }
+
        uterm_video_unref(vid->video);
        free(vid->node);
        free(vid);