weston-log: replace weston_log_ctx_compositor_destroy() by weston_log_ctx_destroy()

The function weston_log_ctx_compositor_destroy(), which destroys struct
weston_log_context, takes weston_compositor as argument. We may have a
weston_log_context unlinked from a weston_compositor and currently there
is no way to destroy it.

Add function weston_log_ctx_destroy(), what makes the destruction of
weston_log_context independent of weston_compositor.

With this change, one could destroy a weston_compositor and keep the
related weston_log_context (since now weston_log_context can be destroyed
without the need of a weston_compositor). But if weston_compositor gets
destroyed it's also necessary to destroy weston_log_context::global,
as the debug protocol depends on the compositor. So a listener has been
added to the destroy signal of weston_compositor.

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
This commit is contained in:
Leandro Ribeiro
2020-01-24 01:12:59 -03:00
parent 4f13595aa7
commit 4ec38d18b3
4 changed files with 44 additions and 10 deletions
+1 -1
View File
@@ -3381,8 +3381,8 @@ out:
weston_log_scope_destroy(log_scope);
log_scope = NULL;
weston_log_ctx_compositor_destroy(wet.compositor);
weston_compositor_destroy(wet.compositor);
weston_log_ctx_destroy(log_ctx);
weston_log_subscriber_destroy_log(logger);
weston_log_subscriber_destroy_flight_rec(flight_rec);