xwayland: Plug memleak in frame callbacks

The frame callback set up via wl_surface_frame() needs to be freed with
wl_callback_destroy() or we'll leak memory.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97065
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
Olivier Fourdan 2016-08-02 11:24:41 +02:00 committed by Adam Jackson
parent 611b3b1d40
commit 4d586118c1
2 changed files with 4 additions and 0 deletions

View File

@ -100,6 +100,8 @@ frame_callback(void *data,
uint32_t time)
{
struct xwl_seat *xwl_seat = data;
wl_callback_destroy (xwl_seat->cursor_frame_cb);
xwl_seat->cursor_frame_cb = NULL;
if (xwl_seat->cursor_needs_update) {
xwl_seat->cursor_needs_update = FALSE;

View File

@ -364,6 +364,8 @@ frame_callback(void *data,
uint32_t time)
{
struct xwl_window *xwl_window = data;
wl_callback_destroy (xwl_window->frame_callback);
xwl_window->frame_callback = NULL;
}