aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominique Martinet <asmadeus@codewreck.org>2017-11-01 19:34:17 +0100
committerDominique Martinet <asmadeus@codewreck.org>2017-11-01 19:37:35 +0100
commitf451ea36393e8cedf29fd9877689b33ae770a8dc (patch)
tree43285c5c6f8a2c10efd36c3f8774519d03667f81
parent1d0973f6c86ac62f03cbec89ceee5211c21dbab1 (diff)
rootston exit: fix drm destroy
wlr_drm_connector were being freed without removing them from the drm->outputs list, segfaulting on destroy
-rw-r--r--backend/drm/backend.c4
-rw-r--r--backend/drm/drm.c2
2 files changed, 4 insertions, 2 deletions
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);
}
diff --git a/backend/drm/drm.c b/backend/drm/drm.c
index 08e6296b..dd247998 100644
--- a/backend/drm/drm.c
+++ b/backend/drm/drm.c
@@ -645,6 +645,7 @@ static void wlr_drm_connector_destroy(struct wlr_output *output) {
struct wlr_drm_connector *conn = (struct wlr_drm_connector *)output;
wlr_drm_connector_cleanup(conn);
wl_event_source_remove(conn->retry_pageflip);
+ wl_list_remove(&conn->link);
free(conn);
}
@@ -823,6 +824,7 @@ void wlr_drm_scan_connectors(struct wlr_drm_backend *drm) {
drmModeFreeCrtc(conn->old_crtc);
wl_event_source_remove(conn->retry_pageflip);
+ wl_list_remove(&conn->link);
free(conn);
}
}