Make the objfile destructor private
[deliverable/binutils-gdb.git] / gdb / symfile.c
index 8e3cf7f23e57b8740edbd54dc6e22eb9d23c5abf..965237191ad197e8c173f07c62c052ead83b95df 100644 (file)
@@ -940,7 +940,7 @@ syms_from_objfile_1 (struct objfile *objfile,
      if an error occurs during symbol reading.  */
   gdb::optional<clear_symtab_users_cleanup> defer_clear_users;
 
-  std::unique_ptr<struct objfile> objfile_holder (objfile);
+  objfile_up objfile_holder (objfile);
 
   /* If ADDRS is NULL, put together a dummy address list.
      We now establish the convention that an addr of zero means
@@ -958,7 +958,7 @@ syms_from_objfile_1 (struct objfile *objfile,
 
       if (symfile_objfile != NULL)
        {
-         delete symfile_objfile;
+         symfile_objfile->unlink ();
          gdb_assert (symfile_objfile == NULL);
        }
 
@@ -2438,7 +2438,7 @@ remove_symbol_file_command (const char *args, int from_tty)
                 objfile_name (objf)))
     error (_("Not confirmed."));
 
-  delete objf;
+  objf->unlink ();
   clear_symtab_users (0);
 }
 
@@ -2495,7 +2495,7 @@ reread_symbols (void)
          /* If we get an error, blow away this objfile (not sure if
             that is the correct response for things like shared
             libraries).  */
-         std::unique_ptr<struct objfile> objfile_holder (objfile);
+         objfile_up objfile_holder (objfile);
 
          /* We need to do this whenever any symbols go away.  */
          clear_symtab_users_cleanup defer_clear_users (0);
This page took 0.024626 seconds and 4 git commands to generate.