]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/python/py-objfile.c
Use class to manage BFD reference counts
[thirdparty/binutils-gdb.git] / gdb / python / py-objfile.c
index 8ac93f9f6f364e6d44783e31df116fcc35a0e6d2..694fa09f2729f5bd7b04d6c21103bb708bdfd2fd 100644 (file)
@@ -445,9 +445,9 @@ objfpy_add_separate_debug_file (PyObject *self, PyObject *args, PyObject *kw)
 
   TRY
     {
-      bfd *abfd = symfile_bfd_open (file_name);
+      gdb_bfd_ref_ptr abfd (symfile_bfd_open (file_name));
 
-      symbol_file_add_separate (abfd, file_name, 0, obj->objfile);
+      symbol_file_add_separate (abfd.get (), file_name, 0, obj->objfile);
     }
   CATCH (except, RETURN_MASK_ALL)
     {