Skip to content

fix some problems related to weston_log_context

Leandro Ribeiro requested to merge leandrohrb/weston:compositor_log_ctx into master

As addressed by @pq in #338 (closed), there are some problems related to struct weston_log_context:


1/4: weston_log_ctx_compositor_setup() is folded into weston_compositor_create(), since it's tiny and being called only once.


2/4: weston_log_ctx_compositor_create() is renamed to weston_log_ctx_create() because it does not take struct weston_compositor as argument.


3/4: adds weston_log_ctx_destroy(), allowing struct weston_log_context that are unlinked from struct weston_compositor to be destroyed.

With this change, one could destroy a struct weston_compositor and keep the related struct weston_log_context. But if struct 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 the compositor.

This could be done moving global to struct weston_compositor, but since the debug protocol is strongly related with the log context (as mentioned by @marius.vlad0 in #338 (comment 390462)), it may be better to do it like this (using a listener, as mentioned before).


4/4: After commit 3/4, it's not necessary to keep a zombie struct weston_compositor just to be able to destroy log_ctx. This allow us to fold weston_compositor_tear_down() into weston_compositor_destroy()


Fixes: #338 (closed)

Edited by Leandro Ribeiro

Merge request reports