diff options
Diffstat (limited to 'gdb/objfiles.c')
-rw-r--r-- | gdb/objfiles.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/gdb/objfiles.c b/gdb/objfiles.c index 1ad5d94..9b30c0f 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -267,15 +267,15 @@ free_objfile (objfile) if (objfile -> obfd != NULL) { + char *name = bfd_get_filename (objfile->obfd); bfd_close (objfile -> obfd); + free (name); } /* Remove it from the chain of all objfiles. */ unlink_objfile (objfile); -#if 0 /* FIXME!! */ - /* Before the symbol table code was redone to make it easier to selectively load and remove information particular to a specific linkage unit, gdb used to do these things whenever the monolithic @@ -289,8 +289,6 @@ free_objfile (objfile) #endif clear_pc_function_cache (); -#endif - /* The last thing we do is free the objfile struct itself for the non-reusable case, or detach from the mapped file for the reusable case. Note that the mmalloc_detach or the mfree is the last thing @@ -319,6 +317,10 @@ free_objfile (objfile) { mfree (objfile -> md, objfile -> name); } + if (objfile->global_psymbols.list) + mfree (objfile->md, objfile->global_psymbols.list); + if (objfile->static_psymbols.list) + mfree (objfile->md, objfile->static_psymbols.list); /* Free the obstacks for non-reusable objfiles */ obstack_free (&objfile -> psymbol_obstack, 0); obstack_free (&objfile -> symbol_obstack, 0); |