summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Agner <stefan@agner.ch>2019-06-20 17:39:36 +0200
committerSimon Ser <contact@emersion.fr>2020-01-13 14:22:30 +0000
commitedcab103daed5ce1691cb95e4eda02bcb1a0c3ab (patch)
tree9d0526fa29a49cf763b2781e02febc9aaa7f7e47
parent163f26f5209c673078dab8d1aba972f9cdc15c1f (diff)
downloadweston-edcab103daed5ce1691cb95e4eda02bcb1a0c3ab.tar.gz
weston-edcab103daed5ce1691cb95e4eda02bcb1a0c3ab.tar.bz2
weston-edcab103daed5ce1691cb95e4eda02bcb1a0c3ab.zip
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>
-rw-r--r--libweston/backend-rdp/rdp.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libweston/backend-rdp/rdp.c b/libweston/backend-rdp/rdp.c
index d21d5283..376ff0de 100644
--- a/libweston/backend-rdp/rdp.c
+++ b/libweston/backend-rdp/rdp.c
@@ -663,8 +663,17 @@ rdp_destroy(struct weston_compositor *ec)
{
struct rdp_backend *b = to_rdp_backend(ec);
struct weston_head *base, *next;
+ struct rdp_peers_item *rdp_peer, *tmp;
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++)
if (b->listener_events[i])
wl_event_source_remove(b->listener_events[i]);