Adapt plugin system to use unified reference counting
[babeltrace.git] / plugins / source.c
index 094cab24cb2c1ac39de06b3635ffd263190f9bcf..2dba33bd432a6bf958ffbf619d3d1af4c11f2e9a 100644 (file)
@@ -26,6 +26,7 @@
  * SOFTWARE.
  */
 
+#include <babeltrace/ref.h>
 #include <babeltrace/compiler.h>
 #include <babeltrace/plugin/source-internal.h>
 #include <babeltrace/plugin/component-internal.h>
@@ -46,7 +47,8 @@ void bt_component_source_destroy(struct bt_component *component)
 }
 
 BT_HIDDEN
-struct bt_component *bt_component_source_create(const char *name)
+struct bt_component *bt_component_source_create(
+               struct bt_component_class *class, const char *name)
 {
        struct bt_component_source *source = NULL;
        enum bt_component_status ret;
@@ -55,8 +57,8 @@ struct bt_component *bt_component_source_create(const char *name)
                goto end;
        }
 
-       ret = bt_component_init(&source->parent, name,
-               BT_COMPONENT_TYPE_SOURCE, bt_component_source_destroy);
+       ret = bt_component_init(&source->parent, class, name,
+               bt_component_source_destroy);
        if (ret != BT_COMPONENT_STATUS_OK) {
                g_free(source);
                source = NULL;
@@ -101,6 +103,6 @@ struct bt_notification_iterator *bt_plugin_source_create_iterator(
 end:
        return iterator;
 error:
-       bt_notification_iterator_put(iterator);
-       return NULL;
+       BT_PUT(iterator);
+       return iterator;
 }
This page took 0.032971 seconds and 4 git commands to generate.