wlserver: Fix use after free on shutdown using content overrides

This commit is contained in:
Joshua Ashton 2023-10-01 02:01:36 +01:00
parent 119b8eda83
commit a2ec78665b

View file

@ -1251,6 +1251,14 @@ gamescope_xwayland_server_t::gamescope_xwayland_server_t(wl_display *display)
gamescope_xwayland_server_t::~gamescope_xwayland_server_t()
{
/* Clear content overrides */
for (auto& co : content_overrides)
{
wl_list_remove( &co.second->surface_destroy_listener.link );
free( co.second );
}
content_overrides.clear();
wlr_xwayland_server_destroy(xwayland_server);
xwayland_server = nullptr;