diff options
author | Simon Ser <contact@emersion.fr> | 2020-06-13 00:52:26 +0200 |
---|---|---|
committer | Tudor Brindus <me@tbrindus.ca> | 2020-06-12 19:37:19 -0400 |
commit | f9361ae36c586d78db34307f538508ab0dd8f486 (patch) | |
tree | dc1b40ed102fcd282dcee411b90ab38b47004e3b | |
parent | view: fix surface_new_subsurface use-after-free (diff) | |
download | sway-f9361ae36c586d78db34307f538508ab0dd8f486.tar.gz sway-f9361ae36c586d78db34307f538508ab0dd8f486.tar.zst sway-f9361ae36c586d78db34307f538508ab0dd8f486.zip |
Remove view child surface_{map,unmap} listeners on destroy
-rw-r--r-- | sway/tree/view.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c index ec481596..ca5af10e 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c | |||
@@ -917,7 +917,9 @@ void view_child_init(struct sway_view_child *child, | |||
917 | 917 | ||
918 | // Not all child views have a map/unmap event | 918 | // Not all child views have a map/unmap event |
919 | child->surface_map.notify = view_child_handle_surface_map; | 919 | child->surface_map.notify = view_child_handle_surface_map; |
920 | wl_list_init(&child->surface_map.link); | ||
920 | child->surface_unmap.notify = view_child_handle_surface_unmap; | 921 | child->surface_unmap.notify = view_child_handle_surface_unmap; |
922 | wl_list_init(&child->surface_unmap.link); | ||
921 | 923 | ||
922 | wl_signal_add(&view->events.unmap, &child->view_unmap); | 924 | wl_signal_add(&view->events.unmap, &child->view_unmap); |
923 | child->view_unmap.notify = view_child_handle_view_unmap; | 925 | child->view_unmap.notify = view_child_handle_view_unmap; |
@@ -948,6 +950,8 @@ void view_child_destroy(struct sway_view_child *child) { | |||
948 | 950 | ||
949 | wl_list_remove(&child->surface_commit.link); | 951 | wl_list_remove(&child->surface_commit.link); |
950 | wl_list_remove(&child->surface_destroy.link); | 952 | wl_list_remove(&child->surface_destroy.link); |
953 | wl_list_remove(&child->surface_map.link); | ||
954 | wl_list_remove(&child->surface_unmap.link); | ||
951 | wl_list_remove(&child->view_unmap.link); | 955 | wl_list_remove(&child->view_unmap.link); |
952 | wl_list_remove(&child->surface_new_subsurface.link); | 956 | wl_list_remove(&child->surface_new_subsurface.link); |
953 | 957 | ||