libweston: Make weston_pointer destruction safe
authorAlexandros Frantzis <alexandros.frantzis@collabora.com>
Thu, 8 Feb 2018 13:37:53 +0000 (15:37 +0200)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Wed, 14 Feb 2018 13:14:16 +0000 (15:14 +0200)
commit1c3a40edcd8f109618d2af3ac7f1e67815faeb05
treed3bad0abcd80571d914b758d7384d65df4513c83
parent0f14ae95b020e8e43da9b5593d1cba8e48f56a55
libweston: Make weston_pointer destruction safe

Properly clean up all sub-objects (e.g., weston_pointer_client objects)
when a weston_pointer object is destroyed. The clean-up ensures that the
server is able to safely handle client requests to any associated
pointer resources, which, as a consenquence of a weston_pointer
destruction, have now become inert.

The clean-up involves, among other things, unsetting the destroyed
weston_pointer object from the user data of pointer resources, and
handling this NULL user data case where required. Note that in many
sites affected by this change the existing code already properly handles
NULL weston_pointer (e.g. in init_pointer_constraint), so there is no
need for additional updates there.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
libweston/input.c
libweston/zoom.c