]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Use gdbpy_enter in py-objfile.c
authorTom Tromey <tom@tromey.com>
Mon, 7 Nov 2016 23:07:53 +0000 (16:07 -0700)
committerTom Tromey <tom@tromey.com>
Wed, 11 Jan 2017 02:13:42 +0000 (19:13 -0700)
Change py-objfile.c to use gdbpy_enter.

2017-01-10  Tom Tromey  <tom@tromey.com>

* python/py-objfile.c (py_free_objfile): Use gdbpy_enter.

gdb/ChangeLog
gdb/python/py-objfile.c

index d3f7b0599b7b54ac25f32635dce8785c6de2a2e9..9062025f3299986535bad19788eabd56a88fa242 100644 (file)
@@ -1,3 +1,7 @@
+2017-01-10  Tom Tromey  <tom@tromey.com>
+
+       * python/py-objfile.c (py_free_objfile): Use gdbpy_enter.
+
 2017-01-10  Tom Tromey  <tom@tromey.com>
 
        * python/py-inferior.c (python_on_normal_stop, python_on_resume)
index 2585f6256eb5fb8635478d82d203b49e5fc30a9e..8ac93f9f6f364e6d44783e31df116fcc35a0e6d2 100644 (file)
@@ -612,13 +612,11 @@ gdbpy_lookup_objfile (PyObject *self, PyObject *args, PyObject *kw)
 static void
 py_free_objfile (struct objfile *objfile, void *datum)
 {
-  struct cleanup *cleanup;
   objfile_object *object = (objfile_object *) datum;
 
-  cleanup = ensure_python_env (get_objfile_arch (objfile), current_language);
+  gdbpy_enter enter_py (get_objfile_arch (objfile), current_language);
   object->objfile = NULL;
   Py_DECREF ((PyObject *) object);
-  do_cleanups (cleanup);
 }
 
 /* Return a borrowed reference to the Python object of type Objfile