diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-10-09 13:41:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-09 13:41:04 +0200 |
commit | 8488ed299745f05ad6445cb22006da20fe926891 (patch) | |
tree | 17818e4b74b7069d2df2aed9277f8cf932f878ee | |
parent | feb0614d3238a52e3eed0beca41fd0694aa7d31e (diff) | |
parent | 46b1ba386f00dfef079b26326a011521026b5f59 (diff) |
Merge pull request #1298 from emersion/output-dangling-idle-frame
output: remove idle_frame event source when destroying output
-rw-r--r-- | backend/drm/drm.c | 7 | ||||
-rw-r--r-- | types/wlr_output.c | 10 |
2 files changed, 12 insertions, 5 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c index 5d589d4f..d6a7582c 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: diff --git a/types/wlr_output.c b/types/wlr_output.c index 35a3ab14..7bcf2556 100644 --- a/types/wlr_output.c +++ b/types/wlr_output.c @@ -298,17 +298,17 @@ void wlr_output_destroy(struct wlr_output *output) { wlr_signal_emit_safe(&output->events.destroy, output); - struct wlr_output_mode *mode, *tmp_mode; - wl_list_for_each_safe(mode, tmp_mode, &output->modes, link) { - wl_list_remove(&mode->link); - free(mode); - } + // The backend is responsible for free-ing the list of modes struct wlr_output_cursor *cursor, *tmp_cursor; wl_list_for_each_safe(cursor, tmp_cursor, &output->cursors, link) { wlr_output_cursor_destroy(cursor); } + if (output->idle_frame != NULL) { + wl_event_source_remove(output->idle_frame); + } + pixman_region32_fini(&output->damage); if (output->impl && output->impl->destroy) { |