Skip to content

swipe-tracker: Fix a leak in hdy_swipe_tracker_confirm_swipe()

Adrien Plazas requested to merge adrien.plazas/libhandy:swipe-leak-fix into master

The swipe tracker takes ownership of the heap-allocated snap points in hdy_swipe_tracker_confirm_swipe(), but if any of the preconditions fail the function would return without freeing that memory. This uses an auto cleanup function to handle these many cases automatically.

This also uses g_clear_pointer() where possible to simplify the code.

CC @exalm

Merge request reports