aboutsummaryrefslogtreecommitdiff
path: root/gdb/symfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/symfile.c')
-rw-r--r--gdb/symfile.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/gdb/symfile.c b/gdb/symfile.c
index eda26cc..4f70445 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -1228,13 +1228,12 @@ symbol_file_clear (int from_tty)
: !query (_("Discard symbol table? "))))
error (_("Not confirmed."));
- free_all_objfiles ();
-
- /* solib descriptors may have handles to objfiles. Since their
- storage has just been released, we'd better wipe the solib
- descriptors as well. */
+ /* solib descriptors may have handles to objfiles. Wipe them before their
+ objfiles get stale by free_all_objfiles. */
no_shared_libraries (NULL, from_tty);
+ free_all_objfiles ();
+
gdb_assert (symfile_objfile == NULL);
if (from_tty)
printf_unfiltered (_("No symbol file now.\n"));