aboutsummaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2011-12-22 19:51:10 +0000
committerTom Tromey <tromey@redhat.com>2011-12-22 19:51:10 +0000
commite848a8a515f6a2a2b036933ed430c0aa6dbc2fde (patch)
treef9a9baa6df49f8417c91191f17e933c9a05d996e /gdb/python
parent87784a4754fe23d02ee8392357a8291ff2b6ed79 (diff)
downloadgdb-e848a8a515f6a2a2b036933ed430c0aa6dbc2fde.zip
gdb-e848a8a515f6a2a2b036933ed430c0aa6dbc2fde.tar.gz
gdb-e848a8a515f6a2a2b036933ed430c0aa6dbc2fde.tar.bz2
PR python/12533:
* value.h (release_value_or_incref): Declare. * value.c (struct value) <released>: New field. (free_all_values, release_value, value_release_to_mark): Update 'released'. (release_value_or_incref): New function. * python/py-value.c (valpy_new): Use release_value_or_incref. (value_to_value_object): Likewise. * varobj.c (install_new_value): Move value_incref earlier.
Diffstat (limited to 'gdb/python')
-rw-r--r--gdb/python/py-value.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/python/py-value.c b/gdb/python/py-value.c
index 05e592f..04e355a 100644
--- a/gdb/python/py-value.c
+++ b/gdb/python/py-value.c
@@ -150,7 +150,7 @@ valpy_new (PyTypeObject *subtype, PyObject *args, PyObject *keywords)
}
value_obj->value = value;
- value_incref (value);
+ release_value_or_incref (value);
value_obj->address = NULL;
value_obj->type = NULL;
value_obj->dynamic_type = NULL;
@@ -1123,7 +1123,7 @@ value_to_value_object (struct value *val)
if (val_obj != NULL)
{
val_obj->value = val;
- value_incref (val);
+ release_value_or_incref (val);
val_obj->address = NULL;
val_obj->type = NULL;
val_obj->dynamic_type = NULL;