aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2012-09-06 20:14:13 +0000
committerTom Tromey <tromey@redhat.com>2012-09-06 20:14:13 +0000
commitf10704261b1ec99df248a2e38f859bb7aa9019cd (patch)
tree5af340827191add9a4a3103c9a8f34217352c6b2
parentdb90b9d320ca4a7a44637ef631c5db8adee76a8c (diff)
downloadgdb-f10704261b1ec99df248a2e38f859bb7aa9019cd.zip
gdb-f10704261b1ec99df248a2e38f859bb7aa9019cd.tar.gz
gdb-f10704261b1ec99df248a2e38f859bb7aa9019cd.tar.bz2
* python/py-newobjfileevent.c (create_new_objfile_event_object):
Don't decref py_objfile.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/python/py-newobjfileevent.c6
2 files changed, 8 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 05b3142..ffc5c94 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2012-09-06 Tom Tromey <tromey@redhat.com>
+
+ * python/py-newobjfileevent.c (create_new_objfile_event_object):
+ Don't decref py_objfile.
+
2012-09-02 Khoo Yit Phang <khooyp@cs.umd.edu>
Do not enable -lmcheck by default when Python is enabled with
diff --git a/gdb/python/py-newobjfileevent.c b/gdb/python/py-newobjfileevent.c
index 3059ae4..46b26ab 100644
--- a/gdb/python/py-newobjfileevent.c
+++ b/gdb/python/py-newobjfileevent.c
@@ -25,23 +25,23 @@ static PyObject *
create_new_objfile_event_object (struct objfile *objfile)
{
PyObject *objfile_event;
- PyObject *py_objfile = NULL;
+ PyObject *py_objfile;
objfile_event = create_event_object (&new_objfile_event_object_type);
if (!objfile_event)
goto fail;
+ /* Note that objfile_to_objfile_object returns a borrowed reference,
+ so we don't need a decref here. */
py_objfile = objfile_to_objfile_object (objfile);
if (!py_objfile || evpy_add_attribute (objfile_event,
"new_objfile",
py_objfile) < 0)
goto fail;
- Py_DECREF (py_objfile);
return objfile_event;
fail:
- Py_XDECREF (py_objfile);
Py_XDECREF (objfile_event);
return NULL;
}