ir: do not try to create initial packet/event fields when opt. FT is NULL
[babeltrace.git] / lib / ctf-ir / event-class.c
index f1859d347cbb58f9b639b141481c2d2358c2a6d1..9f82e176dcd286f0a6cf4f7aa20d1ac0ce45043d 100644 (file)
@@ -45,6 +45,7 @@
 #include <babeltrace/types.h>
 #include <babeltrace/values-internal.h>
 #include <inttypes.h>
+#include <stdlib.h>
 
 static
 void bt_ctf_event_class_destroy(struct bt_object *obj);
@@ -78,12 +79,6 @@ struct bt_ctf_event_class *bt_ctf_event_class_create(const char *name)
                goto error;
        }
 
-       event_class->context = bt_ctf_field_type_structure_create();
-       if (!event_class->context) {
-               BT_LOGE_STR("Cannot create event class's initial context field type object.");
-               goto error;
-       }
-
        event_class->attributes = bt_ctf_attributes_create();
        if (!event_class->attributes) {
                BT_LOGE_STR("Cannot create event class's attributes object.");
@@ -789,9 +784,9 @@ void bt_ctf_event_class_destroy(struct bt_object *obj)
                bt_ctf_event_class_get_id(event_class));
        BT_LOGD_STR("Destroying event class's attributes.");
        bt_ctf_attributes_destroy(event_class->attributes);
-       BT_LOGD_STR("Putting event class's context field type.");
+       BT_LOGD_STR("Putting context field type.");
        bt_put(event_class->context);
-       BT_LOGD_STR("Putting event class's payload field type.");
+       BT_LOGD_STR("Putting payload field type.");
        bt_put(event_class->fields);
        g_free(event_class);
 }
@@ -876,7 +871,7 @@ int bt_ctf_event_class_serialize(struct bt_ctf_event_class *event_class,
 
                default:
                        /* should never happen */
-                       assert(BT_FALSE);
+                       abort();
                        break;
                }
 
This page took 0.024843 seconds and 4 git commands to generate.