diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-01-01 11:33:43 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-01 11:33:43 -0500 |
commit | d438a877fd331bbfa21a17b040dabc6335d2095c (patch) | |
tree | f43059a9571d742ed45fc141fe455a065c3b4fe5 | |
parent | ae3810c2a76541c24ad47e7dd4d36f2b142eef52 (diff) | |
parent | 9ac9ba861f2e3ca549f0494ccaa9a2037b6c721d (diff) |
Merge pull request #545 from emersion/fix-output-destroy
Free fullscreen surface and cursors when destroying output
-rw-r--r-- | include/wlr/types/wlr_output.h | 2 | ||||
-rw-r--r-- | types/wlr_output.c | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/include/wlr/types/wlr_output.h b/include/wlr/types/wlr_output.h index 8e4f5446..6374ae9b 100644 --- a/include/wlr/types/wlr_output.h +++ b/include/wlr/types/wlr_output.h @@ -55,7 +55,7 @@ struct wlr_output { float transform_matrix[16]; - /* Note: some backends may have zero modes */ + // Note: some backends may have zero modes struct wl_list modes; struct wlr_output_mode *current_mode; diff --git a/types/wlr_output.c b/types/wlr_output.c index 46db98b3..2f5a62e5 100644 --- a/types/wlr_output.c +++ b/types/wlr_output.c @@ -272,6 +272,7 @@ void wlr_output_destroy(struct wlr_output *output) { } wlr_output_destroy_global(output); + wlr_output_set_fullscreen_surface(output, NULL); wl_signal_emit(&output->events.destroy, output); @@ -281,6 +282,11 @@ void wlr_output_destroy(struct wlr_output *output) { free(mode); } + 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->impl && output->impl->destroy) { output->impl->destroy(output); } else { |