]> Git Repo - binutils.git/blobdiff - gdb/python/py-progspace.c
Use gdbpy_enter in gdbpy_before_prompt_hook
[binutils.git] / gdb / python / py-progspace.c
index 6fc53cb95d33724f9c2eb2a1d372b7e906b5545d..b0d94589858ee3226263c9638cd4a6099d0a2a3f 100644 (file)
@@ -1,6 +1,6 @@
 /* Python interface to program spaces.
 
-   Copyright (C) 2010-2016 Free Software Foundation, Inc.
+   Copyright (C) 2010-2017 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -323,7 +323,6 @@ pspy_set_type_printers (PyObject *o, PyObject *value, void *ignore)
 static void
 py_free_pspace (struct program_space *pspace, void *datum)
 {
-  struct cleanup *cleanup;
   pspace_object *object = (pspace_object *) datum;
   /* This is a fiction, but we're in a nasty spot: The pspace is in the
      process of being deleted, we can't rely on anything in it.  Plus
@@ -336,10 +335,9 @@ py_free_pspace (struct program_space *pspace, void *datum)
      being deleted.  */
   struct gdbarch *arch = target_gdbarch ();
 
-  cleanup = ensure_python_env (arch, current_language);
+  gdbpy_enter enter_py (arch, current_language);
   object->pspace = NULL;
   Py_DECREF ((PyObject *) object);
-  do_cleanups (cleanup);
 }
 
 /* Return a borrowed reference to the Python object of type Pspace
This page took 0.032936 seconds and 4 git commands to generate.