diff options
author | Tom Tromey <tromey@redhat.com> | 2013-05-20 20:34:48 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2013-05-20 20:34:48 +0000 |
commit | a1dc2890b9843e7bbadb81cf7d733d2954dbb097 (patch) | |
tree | 3064bc1c3ca2b7dd6cbfc970e4e578b9edb51463 /gdb/python/py-param.c | |
parent | c84620664b6cd95ef9d2609c73c6832dba830cdf (diff) | |
download | gdb-a1dc2890b9843e7bbadb81cf7d733d2954dbb097.tar.gz |
* python/py-cmd.c (cmdpy_completer): Use explicit decref.
* python/py-param.c (get_set_value, get_show_value): Use
explicit decrefs.
* python/python.c (start_type_printers, apply_type_printers):
Use explicit decrefs.
Diffstat (limited to 'gdb/python/py-param.c')
-rw-r--r-- | gdb/python/py-param.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/gdb/python/py-param.c b/gdb/python/py-param.c index fbd9a7706f4..a81ab66127d 100644 --- a/gdb/python/py-param.c +++ b/gdb/python/py-param.c @@ -374,8 +374,6 @@ get_set_value (char *args, int from_tty, if (! set_doc_func) goto error; - make_cleanup_py_decref (set_doc_func); - if (PyObject_HasAttr (obj, set_doc_func)) { set_doc_string = call_doc_function (obj, set_doc_func, NULL); @@ -393,10 +391,12 @@ get_set_value (char *args, int from_tty, make_cleanup (xfree, set_doc_string); fprintf_filtered (gdb_stdout, "%s\n", set_doc_string); + Py_XDECREF (set_doc_func); do_cleanups (cleanup); return; error: + Py_XDECREF (set_doc_func); gdbpy_print_stack (); do_cleanups (cleanup); return; @@ -422,8 +422,6 @@ get_show_value (struct ui_file *file, int from_tty, if (! show_doc_func) goto error; - make_cleanup_py_decref (show_doc_func); - if (PyObject_HasAttr (obj, show_doc_func)) { PyObject *val_obj = PyString_FromString (value); @@ -431,9 +429,8 @@ get_show_value (struct ui_file *file, int from_tty, if (! val_obj) goto error; - make_cleanup_py_decref (val_obj); - show_doc_string = call_doc_function (obj, show_doc_func, val_obj); + Py_DECREF (val_obj); if (! show_doc_string) goto error; @@ -451,10 +448,12 @@ get_show_value (struct ui_file *file, int from_tty, fprintf_filtered (file, "%s %s\n", show_doc_string, value); } + Py_XDECREF (show_doc_func); do_cleanups (cleanup); return; error: + Py_XDECREF (show_doc_func); gdbpy_print_stack (); do_cleanups (cleanup); return; |