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.
This commit is contained in:
emersion 2018-10-09 10:25:38 +02:00
parent 75005fd58d
commit 46b1ba386f
2 changed files with 12 additions and 5 deletions

View file

@ -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: