Fix server crash when a client dies during a drag with an icon

If a client dies during a drag that it started using an icon surface,
the server could crash because the icon surface is not valid anymore.

Fix this by using a destroy listener to reset device->drag_surface to
nil when the surface is destroyed.
This commit is contained in:
Ander Conselvan de Oliveira 2012-03-01 14:09:42 +02:00 committed by Kristian Høgsberg
parent cb3e102620
commit e7f6c509e2
2 changed files with 19 additions and 1 deletions

View file

@ -232,6 +232,7 @@ struct wl_input_device {
struct wl_listener drag_focus_listener;
struct wl_pointer_grab drag_grab;
struct wl_surface *drag_surface;
struct wl_listener drag_icon_listener;
struct wl_data_source *selection_data_source;
struct wl_listener selection_data_source_listener;