+static
+void bt_ctf_field_type_destroy(struct bt_ctf_ref *ref)
+{
+ struct bt_ctf_field_type *type;
+ enum ctf_type_id type_id;
+
+ if (!ref) {
+ return;
+ }
+
+ type = container_of(ref, struct bt_ctf_field_type, ref_count);
+ type_id = type->declaration->id;
+ if (type_id <= CTF_TYPE_UNKNOWN ||
+ type_id >= NR_CTF_TYPES) {
+ return;
+ }
+
+ if (type->alias_name) {
+ g_string_free(type->alias_name, TRUE);
+ }
+ type_destroy_funcs[type_id](ref);
+}
+