Register sink components to the event notification by default
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 25 Feb 2016 17:30:28 +0000 (12:30 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 27 May 2017 16:57:26 +0000 (12:57 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
lib/plugin-system/sink.c

index 4f705a00134c11d68850e515ef1d3a9984c47a48..c1d1df066859cbf2ed637634c70d57f71effed60 100644 (file)
@@ -69,13 +69,22 @@ struct bt_component *bt_component_sink_create(
                goto end;
        }
 
-       ret = bt_component_init(&sink->parent, bt_component_sink_destroy);
+       sink->parent.class = bt_get(class);
+       ret = bt_component_init(&sink->parent, NULL);
        if (ret != BT_COMPONENT_STATUS_OK) {
-               BT_PUT(sink);
-               goto end;
+               goto error;
+       }
+
+       ret = bt_component_sink_register_notification_type(&sink->parent,
+               BT_NOTIFICATION_TYPE_EVENT);
+       if (ret != BT_COMPONENT_STATUS_OK) {
+               goto error;
        }
 end:
        return sink ? &sink->parent : NULL;
+error:
+       BT_PUT(sink);
+       return NULL;
 }
 
 enum bt_component_status bt_component_sink_handle_notification(
This page took 0.027397 seconds and 4 git commands to generate.