weston-log: merge functions that destroy different types of subscribers

Log subscriber API is not type-safe. File and flight recorder
subscribers are created with functions that return
weston_log_subscriber objects. But there's a problem: to destroy
these objects you have to call the right function for each type
of subscriber, and a user calling the wrong destroy function
wouldn't get a warning.

Merge functions that destroy different types of subscribers, making
the log subscriber API type-safe.

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
This commit is contained in:
Leandro Ribeiro
2020-02-06 16:43:51 -03:00
committed by Pekka Paalanen
parent 8c02ea1069
commit 1ded661aac
7 changed files with 49 additions and 45 deletions
+2 -2
View File
@@ -3381,8 +3381,8 @@ out:
weston_log_scope_destroy(log_scope);
log_scope = NULL;
weston_log_ctx_destroy(log_ctx);
weston_log_subscriber_destroy_log(logger);
weston_log_subscriber_destroy_flight_rec(flight_rec);
weston_log_subscriber_destroy(logger);
weston_log_subscriber_destroy(flight_rec);
out_signals:
for (i = ARRAY_LENGTH(signals) - 1; i >= 0; i--)