Component creation
[babeltrace.git] / plugins / sink.c
index 9647f2191bd3c5c28470d953f8e046b8473a4641..363a66c7fe26d9e9a4bda385f9f75b1b8de18d85 100644 (file)
@@ -44,7 +44,8 @@ void bt_component_sink_destroy(struct bt_component *component)
 }
 
 BT_HIDDEN
-struct bt_component *bt_component_sink_create(const char *name)
+struct bt_component *bt_component_sink_create(
+               struct bt_component_class *class, const char *name)
 {
        struct bt_component_sink *sink = NULL;
        enum bt_component_status ret;
@@ -54,11 +55,10 @@ struct bt_component *bt_component_sink_create(const char *name)
                goto end;
        }
 
-       ret = bt_component_init(&sink->parent, name, BT_COMPONENT_TYPE_SINK,
+       ret = bt_component_init(&sink->parent, class, name,
                bt_component_sink_destroy);
        if (ret != BT_COMPONENT_STATUS_OK) {
-               g_free(sink);
-               sink = NULL;
+               BT_PUT(sink);
                goto end;
        }
 end:
This page took 0.022803 seconds and 4 git commands to generate.