backend-rdp: disconnect and free peers on compositor shutdown

Properly disconnect and free all RDP peers on compositor shutdown.
This makes sure that all events are disabled, which should avoid
any race conditions with pending events.

Signed-off-by: Stefan Agner <stefan@agner.ch>
dev
Stefan Agner 6 years ago committed by Simon Ser
parent 163f26f520
commit edcab103da
  1. 9
      libweston/backend-rdp/rdp.c

@ -663,8 +663,17 @@ rdp_destroy(struct weston_compositor *ec)
{ {
struct rdp_backend *b = to_rdp_backend(ec); struct rdp_backend *b = to_rdp_backend(ec);
struct weston_head *base, *next; struct weston_head *base, *next;
struct rdp_peers_item *rdp_peer, *tmp;
int i; int i;
wl_list_for_each_safe(rdp_peer, tmp, &b->output->peers, link) {
freerdp_peer* client = rdp_peer->peer;
client->Disconnect(client);
freerdp_peer_context_free(client);
freerdp_peer_free(client);
}
for (i = 0; i < MAX_FREERDP_FDS; i++) for (i = 0; i < MAX_FREERDP_FDS; i++)
if (b->listener_events[i]) if (b->listener_events[i])
wl_event_source_remove(b->listener_events[i]); wl_event_source_remove(b->listener_events[i]);

Loading…
Cancel
Save