From f451ea36393e8cedf29fd9877689b33ae770a8dc Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Wed, 1 Nov 2017 19:34:17 +0100 Subject: rootston exit: fix drm destroy wlr_drm_connector were being freed without removing them from the drm->outputs list, segfaulting on destroy --- backend/drm/backend.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'backend/drm/backend.c') diff --git a/backend/drm/backend.c b/backend/drm/backend.c index af2619ff..87a4f708 100644 --- a/backend/drm/backend.c +++ b/backend/drm/backend.c @@ -29,8 +29,8 @@ static void wlr_drm_backend_destroy(struct wlr_backend *backend) { wlr_drm_restore_outputs(drm); - struct wlr_drm_connector *conn; - wl_list_for_each(conn, &drm->outputs, link) { + struct wlr_drm_connector *conn, *next; + wl_list_for_each_safe(conn, next, &drm->outputs, link) { wlr_output_destroy(&conn->output); } -- cgit v1.2.3