Skip to content
This repository has been archived by the owner on Jan 26, 2024. It is now read-only.

Prevent using a wlr_layer_surface after destroying it #421

Merged
merged 1 commit into from
May 26, 2023

Conversation

minego
Copy link

@minego minego commented May 24, 2023

If the createlayersurface callback is hit when selmon is NULL then wlr_layer_surface is destroyed by calling wlr_layer_surface_v1_destroy(). This change simply adds a return at that point, to prevent a crash caused by dereferencing the destroyed variable.

The crash in question can be reproduced easily by unplugging or turning off all monitors while running swaync, waiting a few seconds and then plugging them back in. It is likely possible to cause this with things other than swaync, but that was the application that triggered it for me.

@sevz17 sevz17 merged commit 0729f18 into djpohly:main May 26, 2023
@sevz17
Copy link
Collaborator

sevz17 commented May 26, 2023

Thanks!

@minego
Copy link
Author

minego commented May 26, 2023 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants