libweston: Remove signals from the list during de-init

During de-init ensure removal of added signals from list. Otherwise
a dongling pointer is left behind which will affect other plugins.

Signed-off-by: Harsha M M <harsha.manjulamallikarjun@in.bosch.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
dev
Harsha M M 6 years ago committed by Pekka Paalanen
parent 103dc42b5e
commit b8b2c72709
  1. 3
      compositor/text-backend.c
  2. 2
      compositor/weston-screenshooter.c
  3. 1
      desktop-shell/shell.c

@ -452,6 +452,7 @@ text_input_manager_notifier_destroy(struct wl_listener *listener, void *data)
struct text_input_manager, struct text_input_manager,
destroy_listener); destroy_listener);
wl_list_remove(&text_input_manager->destroy_listener.link);
wl_global_destroy(text_input_manager->text_input_manager_global); wl_global_destroy(text_input_manager->text_input_manager_global);
free(text_input_manager); free(text_input_manager);
@ -1060,6 +1061,8 @@ text_backend_configuration(struct text_backend *text_backend)
WL_EXPORT void WL_EXPORT void
text_backend_destroy(struct text_backend *text_backend) text_backend_destroy(struct text_backend *text_backend)
{ {
wl_list_remove(&text_backend->seat_created_listener.link);
if (text_backend->input_method.client) { if (text_backend->input_method.client) {
/* disable respawn */ /* disable respawn */
wl_list_remove(&text_backend->client_listener.link); wl_list_remove(&text_backend->client_listener.link);

@ -162,6 +162,8 @@ screenshooter_destroy(struct wl_listener *listener, void *data)
struct screenshooter *shooter = struct screenshooter *shooter =
container_of(listener, struct screenshooter, destroy_listener); container_of(listener, struct screenshooter, destroy_listener);
wl_list_remove(&shooter->destroy_listener.link);
wl_global_destroy(shooter->global); wl_global_destroy(shooter->global);
free(shooter); free(shooter);
} }

@ -4911,6 +4911,7 @@ shell_destroy(struct wl_listener *listener, void *data)
wl_client_destroy(shell->child.client); wl_client_destroy(shell->child.client);
} }
wl_list_remove(&shell->destroy_listener.link);
wl_list_remove(&shell->idle_listener.link); wl_list_remove(&shell->idle_listener.link);
wl_list_remove(&shell->wake_listener.link); wl_list_remove(&shell->wake_listener.link);
wl_list_remove(&shell->transform_listener.link); wl_list_remove(&shell->transform_listener.link);

Loading…
Cancel
Save