Skip to content

Commit

Permalink
shell: Fix crash when a client is destroyed during the resize grab
Browse files Browse the repository at this point in the history
If a client exists during a resize grab, the resource for the shell
surface being resized is destroyed. The shell surface is not destroyed
immediately, however, because of the window close animation. In that
case, the compositor would crash trying to send configure events to
the surface being resized, since it would pass a NULL pointer to
wl_resource_post_event().

The code for the resize grab was already able to handle the surface
going away, so expand it to also handle the resource going away and
fix the crash.

https://bugs.freedesktop.org/show_bug.cgi?id=77344
  • Loading branch information
Ander Conselvan de Oliveira authored and krh committed Apr 29, 2014
1 parent 15f9a26 commit 9c376b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion desktop-shell/shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -1594,7 +1594,7 @@ resize_grab_motion(struct weston_pointer_grab *grab, uint32_t time,

weston_pointer_move(pointer, x, y);

if (!shsurf)
if (!shsurf || !shsurf->resource)
return;

weston_view_from_global_fixed(shsurf->view,
Expand Down

0 comments on commit 9c376b5

Please sign in to comment.