X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=lib%2Fplugin-system%2Fcomponent.c;h=643e17ad21b3ad909862f556d35aae55e00fbff8;hb=fec2a9f220bdae0ce64716538c111348302f2696;hp=b580bb5d0ae89acc2acd433ce23dab643dbe1f87;hpb=91e6e0b835e1a534c2e35929aed305255f0edf07;p=babeltrace.git diff --git a/lib/plugin-system/component.c b/lib/plugin-system/component.c index b580bb5d..643e17ad 100644 --- a/lib/plugin-system/component.c +++ b/lib/plugin-system/component.c @@ -131,7 +131,9 @@ struct bt_component *bt_component_create( goto end; } + component->initializing = true; component_class->init(component, params); + component->initializing = false; ret = component_validation_funcs[type](component); if (ret != BT_COMPONENT_STATUS_OK) { BT_PUT(component); @@ -186,7 +188,7 @@ bt_component_set_private_data(struct bt_component *component, { enum bt_component_status ret = BT_COMPONENT_STATUS_OK; - if (!component) { + if (!component || !component->initializing) { ret = BT_COMPONENT_STATUS_INVALID; goto end; } @@ -201,7 +203,7 @@ enum bt_component_status bt_component_set_destroy_cb( { enum bt_component_status ret = BT_COMPONENT_STATUS_OK; - if (!component) { + if (!component || !component->initializing) { ret = BT_COMPONENT_STATUS_INVALID; goto end; }