diff options
author | Tom Tromey <tromey@redhat.com> | 2013-05-20 20:34:49 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2013-05-20 20:34:49 +0000 |
commit | 3d4a3c3ea2536c69a01c8c13b851784aa1b5d956 (patch) | |
tree | 15902bcff8cd0936739d0b493c50fb77277112a8 /gdb/python/py-param.c | |
parent | 72ff8829c136d4337f010bcf7e655a8f8797b55c (diff) | |
download | gdb-3d4a3c3ea2536c69a01c8c13b851784aa1b5d956.zip gdb-3d4a3c3ea2536c69a01c8c13b851784aa1b5d956.tar.gz gdb-3d4a3c3ea2536c69a01c8c13b851784aa1b5d956.tar.bz2 |
* 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 fbd9a77..a81ab66 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; |