From: Jérémie Galarneau Date: Tue, 30 Aug 2016 20:33:33 +0000 (-0400) Subject: Accomodate component destructor API changes in text plugin X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=b25bd4558ba877331e5456b9f3ad04610f6f2693;p=deliverable%2Fbabeltrace.git Accomodate component destructor API changes in text plugin Signed-off-by: Jérémie Galarneau --- diff --git a/plugins/text/text.c b/plugins/text/text.c index 8f72b999e..a269fe160 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.");