* python/py-newobjfileevent.c (create_new_objfile_event_object):

Don't decref py_objfile.
This commit is contained in:
Tom Tromey 2012-09-06 20:14:13 +00:00
parent db90b9d320
commit f10704261b
2 changed files with 8 additions and 3 deletions

View file

@ -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> 2012-09-02 Khoo Yit Phang <khooyp@cs.umd.edu>
Do not enable -lmcheck by default when Python is enabled with Do not enable -lmcheck by default when Python is enabled with

View file

@ -25,23 +25,23 @@ static PyObject *
create_new_objfile_event_object (struct objfile *objfile) create_new_objfile_event_object (struct objfile *objfile)
{ {
PyObject *objfile_event; PyObject *objfile_event;
PyObject *py_objfile = NULL; PyObject *py_objfile;
objfile_event = create_event_object (&new_objfile_event_object_type); objfile_event = create_event_object (&new_objfile_event_object_type);
if (!objfile_event) if (!objfile_event)
goto fail; 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); py_objfile = objfile_to_objfile_object (objfile);
if (!py_objfile || evpy_add_attribute (objfile_event, if (!py_objfile || evpy_add_attribute (objfile_event,
"new_objfile", "new_objfile",
py_objfile) < 0) py_objfile) < 0)
goto fail; goto fail;
Py_DECREF (py_objfile);
return objfile_event; return objfile_event;
fail: fail:
Py_XDECREF (py_objfile);
Py_XDECREF (objfile_event); Py_XDECREF (objfile_event);
return NULL; return NULL;
} }