compositor: add wlsc_input_device_fini()

Add a function for destroying all objects allocated in
wlsc_input_device_init().

This patch depends on "server: add wl_input_device_fini()" commit in the
Wayland core.

Compositor backends could now call wlsc_input_device_fini() to fix some
memory leaks.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
dev
Pekka Paalanen 13 years ago
parent d1591ae3cc
commit 07753fbe9c
  1. 12
      compositor/compositor.c
  2. 3
      compositor/compositor.h

@ -1677,6 +1677,18 @@ wlsc_input_device_init(struct wlsc_input_device *device,
device->selection_data_source = NULL;
}
WL_EXPORT void
wlsc_input_device_fini(struct wlsc_input_device *device)
{
wl_list_remove(&device->link);
/* The global object is destroyed at wl_display_destroy() time. */
if (device->sprite)
destroy_surface(&device->sprite->surface.resource);
wl_input_device_fini(&device->input_device);
}
static void
bind_output(struct wl_client *client,
void *data, uint32_t version, uint32_t id)

@ -407,6 +407,9 @@ void
wlsc_input_device_init(struct wlsc_input_device *device,
struct wlsc_compositor *ec);
void
wlsc_input_device_fini(struct wlsc_input_device *device);
void
wlsc_switcher_init(struct wlsc_compositor *compositor);

Loading…
Cancel
Save