Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Destroy Sway subsurfaces when destroying Sway layer_surface #6421

Closed
wants to merge 1 commit into from
Closed

Destroy Sway subsurfaces when destroying Sway layer_surface #6421

wants to merge 1 commit into from

Conversation

numberZero
Copy link

Seems to fix #6337

Otherwise destroying wlr_layer_surface could destroy sway_layer_surface
before destroying its subsurfaces that would try to access the
sway_layer_surface regardless, possibly crashing Sway.
@@ -47,6 +51,7 @@ struct sway_layer_subsurface {
struct wl_listener unmap;
struct wl_listener destroy;
struct wl_listener commit;
struct wl_listener surface_destroy;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of setting up an event listener, can we just iterate over the layer sub-surfaces and destroy them in handle_destroy?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably. I did it this way only because everything else here seems to work this way. What you suggest is probably better.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rest of the event listeners are listening to wlroots events. wlroots doesn't know about Sway, so we need this complexity in the wlroots API.

However for Sway-internal stuff we shouldn't need it.

@emersion
Copy link
Member

Superseded by #6728

@emersion emersion closed this Jan 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Use after free in client→surface→subsurface destroy
2 participants