summaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorMarius Vlad <marius.vlad@collabora.com>2020-10-29 22:59:02 +0200
committerMarius Vlad <marius.vlad@collabora.com>2020-10-29 23:03:33 +0200
commitb4d7a5a1861dc5028f3b1dff0e8432a2829208f2 (patch)
tree2a82dc34360e1844125615c02de9f0c382e6f8d3 /src/main.c
parentfe771c084c2f0192ca08dd3b7f85088960703e36 (diff)
main: Use the output handler to destroy to black view
Use the specific output destroyer handler, instead of destroying it in the handler itself. This way we can still clean-up and avoid any leaks, and still not trip ourselves causing a use-after-free, when the output is destroyed by libweston. Bug-AGL: SPEC-3630, SPEC-3672 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Reported-by: Walter Lozano <walter.lozano@collabora.com> Change-Id: I11916245b85d2541286ee438284601b466dc20c2
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index e85d788..8492f54 100644
--- a/src/main.c
+++ b/src/main.c
@@ -74,6 +74,11 @@ handle_output_destroy(struct wl_listener *listener, void *data)
output = wl_container_of(listener, output, output_destroy);
assert(output->output == data);
+ if (output->fullscreen_view.fs->view) {
+ weston_surface_destroy(output->fullscreen_view.fs->view->surface);
+ output->fullscreen_view.fs->view = NULL;
+ }
+
output->output = NULL;
wl_list_remove(&output->output_destroy.link);
}