From: Jérémie Galarneau Date: Thu, 25 Feb 2016 17:29:32 +0000 (-0500) Subject: Implement bt_component_set_destroy_cb X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=42d7dce557485a48af298996a973f3f41a554267;p=deliverable%2Fbabeltrace.git Implement bt_component_set_destroy_cb Signed-off-by: Jérémie Galarneau --- diff --git a/lib/plugin-system/component.c b/lib/plugin-system/component.c index 4144d5d4d..859350798 100644 --- a/lib/plugin-system/component.c +++ b/lib/plugin-system/component.c @@ -195,3 +195,18 @@ bt_component_set_private_data(struct bt_component *component, end: return ret; } + +enum bt_component_status bt_component_set_destroy_cb( + struct bt_component *component, bt_component_destroy_cb destroy) +{ + enum bt_component_status ret = BT_COMPONENT_STATUS_OK; + + if (!component) { + ret = BT_COMPONENT_STATUS_INVALID; + goto end; + } + + component->user_destroy = destroy; +end: + return ret; +}