Change objfile_to_objfile_object to return a new reference
[deliverable/binutils-gdb.git] / gdb / python / python.c
index 66b6631f93a33ba9d143466cd01fff96d3a55295..1a0562a22751e05b9591382f7c24b6744bf3b8bf 100644 (file)
@@ -1359,15 +1359,10 @@ gdbpy_execute_objfile_script (const struct extension_language_defn *extlang,
 static PyObject *
 gdbpy_get_current_objfile (PyObject *unused1, PyObject *unused2)
 {
-  PyObject *result;
-
   if (! gdbpy_current_objfile)
     Py_RETURN_NONE;
 
-  result = objfile_to_objfile_object (gdbpy_current_objfile);
-  if (result)
-    Py_INCREF (result);
-  return result;
+  return objfile_to_objfile_object (gdbpy_current_objfile).release ();
 }
 
 /* Compute the list of active python type printers and store them in
This page took 0.023662 seconds and 4 git commands to generate.