backend-rdp: Correctly tear down the RDP back-end
This fixes the tear-down and the destroying part in case RDP back-end couldn't be initialized. The first issue is the rdp_output which will not be created in some circumstances (can't open the socket for instance) and requires a guard check, and secondly, the rdp_head being created above of that, wasn't removed and tripped an assert when destroying the compositor instance. Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
This commit is contained in:
@@ -1297,6 +1297,8 @@ rdp_backend_create(struct weston_compositor *compositor,
|
|||||||
char *fd_tail;
|
char *fd_tail;
|
||||||
int fd, ret;
|
int fd, ret;
|
||||||
|
|
||||||
|
struct weston_head *base, *next;
|
||||||
|
|
||||||
b = zalloc(sizeof *b);
|
b = zalloc(sizeof *b);
|
||||||
if (b == NULL)
|
if (b == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -1369,8 +1371,12 @@ rdp_backend_create(struct weston_compositor *compositor,
|
|||||||
err_listener:
|
err_listener:
|
||||||
freerdp_listener_free(b->listener);
|
freerdp_listener_free(b->listener);
|
||||||
err_output:
|
err_output:
|
||||||
weston_output_release(&b->output->base);
|
if (b->output)
|
||||||
|
weston_output_release(&b->output->base);
|
||||||
err_compositor:
|
err_compositor:
|
||||||
|
wl_list_for_each_safe(base, next, &compositor->head_list, compositor_link)
|
||||||
|
rdp_head_destroy(to_rdp_head(base));
|
||||||
|
|
||||||
weston_compositor_shutdown(compositor);
|
weston_compositor_shutdown(compositor);
|
||||||
err_free_strings:
|
err_free_strings:
|
||||||
free(b->rdp_key);
|
free(b->rdp_key);
|
||||||
|
|||||||
Reference in New Issue
Block a user