diff options
author | emersion <contact@emersion.fr> | 2018-10-09 10:25:38 +0200 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2018-10-09 10:55:03 +0200 |
commit | 46b1ba386f00dfef079b26326a011521026b5f59 (patch) | |
tree | 9b2d28049d492182e5868b1a949cef028788553b /backend/drm | |
parent | 75005fd58dcf82f8775e1216fb98c9ad3287d116 (diff) |
output: remove idle_frame event source when destroying output
This prevents the idle event to be activated on a destroyed
output.
This also makes the backend responsible for free-ing modes, as it
is the one allocating them and adding them to the list. Note that
the DRM backend (the only one using modes) already frees them.
Diffstat (limited to 'backend/drm')
-rw-r--r-- | backend/drm/drm.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c index 00525762..b8ef984b 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -1347,6 +1347,13 @@ static void drm_connector_cleanup(struct wlr_drm_connector *conn) { memset(&conn->output.model, 0, sizeof(conn->output.model)); memset(&conn->output.serial, 0, sizeof(conn->output.serial)); + if (conn->output.idle_frame != NULL) { + wl_event_source_remove(conn->output.idle_frame); + conn->output.idle_frame = NULL; + } + conn->output.needs_swap = false; + conn->output.frame_pending = false; + conn->pageflip_pending = false; /* Fallthrough */ case WLR_DRM_CONN_NEEDS_MODESET: |