From b25bd4558ba877331e5456b9f3ad04610f6f2693 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Tue, 30 Aug 2016 16:33:33 -0400 Subject: [PATCH] Accomodate component destructor API changes in text plugin MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérémie Galarneau --- plugins/text/text.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/plugins/text/text.c b/plugins/text/text.c index 8f72b999..a269fe16 100644 --- a/plugins/text/text.c +++ b/plugins/text/text.c @@ -99,11 +99,19 @@ struct text_component *create_text(void) return g_new0(struct text_component, 1); } -static void destroy_text(void *data) +static +void destroy_text_data(struct text_component *data) { g_free(data); } +static void destroy_text(struct bt_component *component) +{ + void *data = bt_component_get_private_data(component); + + destroy_text_data(data); +} + static enum bt_component_status handle_notification(struct bt_component *component, struct bt_notification *notification) @@ -135,18 +143,17 @@ enum bt_component_status text_component_init( } ret = bt_component_sink_set_handle_notification_cb(component, - handle_notification); + handle_notification); if (ret != BT_COMPONENT_STATUS_OK) { goto error; } end: return ret; error: - destroy_text(text); + destroy_text_data(text); return ret; } - /* Initialize plug-in entry points. */ BT_PLUGIN_NAME("ctf-text"); BT_PLUGIN_DESCRIPTION("Babeltrace text output plug-in."); -- 2.34.1