lib: trace IR, values: reset pointers to `NULL` on destruction
[babeltrace.git] / lib / values.c
index d91b5f2ef8e128e5368718dddf72423093c8c6c6..ffe289c2bdeec5d44e3466619ebfbf0090866e60 100644 (file)
@@ -1,8 +1,4 @@
 /*
- * Values.c: value objects
- *
- * Babeltrace Library
- *
  * Copyright (c) 2015 EfficiOS Inc. and Linux Foundation
  * Copyright (c) 2015 Philippe Proulx <pproulx@efficios.com>
  *
@@ -134,6 +130,7 @@ static
 void bt_value_string_destroy(struct bt_value *object)
 {
        g_string_free(BT_VALUE_TO_STRING(object)->gstr, TRUE);
+       BT_VALUE_TO_STRING(object)->gstr = NULL;
 }
 
 static
@@ -144,6 +141,7 @@ void bt_value_array_destroy(struct bt_value *object)
         * of putting each contained object.
         */
        g_ptr_array_free(BT_VALUE_TO_ARRAY(object)->garray, TRUE);
+       BT_VALUE_TO_ARRAY(object)->garray = NULL;
 }
 
 static
@@ -155,6 +153,7 @@ void bt_value_map_destroy(struct bt_value *object)
         * be destroyed anyway.
         */
        g_hash_table_destroy(BT_VALUE_TO_MAP(object)->ght);
+       BT_VALUE_TO_MAP(object)->ght = NULL;
 }
 
 static
@@ -1303,9 +1302,3 @@ bt_bool bt_value_compare(const struct bt_value *object_a,
 end:
        return ret;
 }
-
-struct bt_value *bt_value_borrow_from_private(
-               struct bt_private_value *priv_value)
-{
-       return (void *) priv_value;
-}
This page took 0.022875 seconds and 4 git commands to generate.