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>
This commit is contained in:
Pekka Paalanen 2012-01-02 15:31:01 +02:00
parent d1591ae3cc
commit 07753fbe9c
2 changed files with 15 additions and 0 deletions

View File

@ -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)

View File

@ -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);