Accomodate component destructor API changes in text plugin
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 30 Aug 2016 20:33:33 +0000 (16:33 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 27 May 2017 18:09:05 +0000 (14:09 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
plugins/text/text.c

index 8f72b999eb18fc74ea574c9a6ad0cdf767ff9678..a269fe160742c1cfa49a435a258f50c662f365ee 100644 (file)
@@ -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.");
This page took 0.026258 seconds and 4 git commands to generate.