correctly handle xdg surface deletion and pointer clearing

fixes crashing/leaking when deleting surfaces
This commit is contained in:
Mike Blumenkrantz 2016-11-29 11:08:46 -05:00
parent 19a902ec09
commit 2a9d4e73c5
1 changed files with 5 additions and 9 deletions

View File

@ -24,19 +24,15 @@ e_shell_surface_destroy(struct wl_resource *resource)
ec->comp_data->grab = 0;
}
shd = ec->comp_data->shell.data;
if (resource == ec->comp_data->shell.surface)
ec->comp_data->shell.surface = NULL;
shd = ec->comp_data->shell.data;
if (shd)
{
E_FREE_LIST(shd->pending, free);
if ((resource == ec->comp_data->shell.surface) || (resource == shd->surface))
{
if (ec->comp_data->shell.surface == resource)
ec->comp_data->shell.surface = NULL;
else
shd->surface = NULL;
E_FREE(ec->comp_data->shell.data);
}
if (resource == shd->surface)
E_FREE(ec->comp_data->shell.data);
}
if (ec->comp_data->mapped)