Always evaluate BT_ASSERT(); add BT_ASSERT_DBG() for debug mode only
[babeltrace.git] / src / plugins / text / pretty / pretty.c
index 3f693e5a815d524f000998a304cbeb3241419789..d496734f137346e8001f64fe35b2b80274221699 100644 (file)
@@ -46,6 +46,10 @@ const char * const in_port_name = "in";
 static
 void destroy_pretty_data(struct pretty_component *pretty)
 {
+       if (!pretty) {
+               goto end;
+       }
+
        bt_self_component_port_input_message_iterator_put_ref(pretty->iterator);
 
        if (pretty->string) {
@@ -66,6 +70,9 @@ void destroy_pretty_data(struct pretty_component *pretty)
        }
        g_free(pretty->options.output_path);
        g_free(pretty);
+
+end:
+       return;
 }
 
 static
@@ -109,7 +116,7 @@ bt_component_class_message_iterator_next_method_status handle_message(
        bt_component_class_message_iterator_next_method_status ret =
                BT_COMPONENT_CLASS_MESSAGE_ITERATOR_NEXT_METHOD_STATUS_OK;
 
-       BT_ASSERT(pretty);
+       BT_ASSERT_DBG(pretty);
 
        switch (bt_message_get_type(message)) {
        case BT_MESSAGE_TYPE_EVENT:
@@ -192,7 +199,7 @@ bt_component_class_sink_consume_method_status pretty_consume(
                goto end;
        }
 
-       BT_ASSERT(next_status == BT_MESSAGE_ITERATOR_NEXT_STATUS_OK);
+       BT_ASSERT_DBG(next_status == BT_MESSAGE_ITERATOR_NEXT_STATUS_OK);
 
        for (i = 0; i < count; i++) {
                ret = (int) handle_message(pretty, msgs[i]);
This page took 0.023332 seconds and 4 git commands to generate.