class->help = NULL;
}
+ if (class->plugin_name) {
+ g_string_free(class->plugin_name, TRUE);
+ class->plugin_name = NULL;
+ }
+
if (class->destroy_listeners) {
g_array_free(class->destroy_listeners, TRUE);
class->destroy_listeners = NULL;
goto error;
}
+ class->plugin_name = g_string_new(NULL);
+ if (!class->plugin_name) {
+ BT_LOGE_STR("Failed to allocate a GString.");
+ goto error;
+ }
+
class->destroy_listeners = g_array_new(FALSE, TRUE,
sizeof(struct bt_component_class_destroy_listener));
if (!class->destroy_listeners) {
abort();
}
+ /* Set component class's original plugin name */
+ BT_ASSERT(comp_class->plugin_name);
+ BT_ASSERT(plugin->info.name);
+ g_string_assign(comp_class->plugin_name, plugin->info.name->str);
+
/* Add new component class */
bt_object_get_ref(comp_class);
g_ptr_array_add(comp_classes, comp_class);