aboutsummaryrefslogtreecommitdiff
path: root/gdb/event-top.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2022-08-11 13:16:46 -0600
committerTom Tromey <tromey@adacore.com>2022-08-31 11:03:40 -0600
commitb8043d27217ff89abba733476cb71c3656f5722a (patch)
treea7efa23160073f021426d105a703536b3205b4aa /gdb/event-top.c
parent4311c583a6ac84e880207bf0418872f407557e60 (diff)
downloadgdb-b8043d27217ff89abba733476cb71c3656f5722a.zip
gdb-b8043d27217ff89abba733476cb71c3656f5722a.tar.gz
gdb-b8043d27217ff89abba733476cb71c3656f5722a.tar.bz2
Remove a ui-related memory leak
gdb_setup_readline makes new streams and assigns to the various stream members of struct ui. However, these assignments cause the previous values to leak. As far as I can, this code is simply unnecessary and can be removed -- with the exception of the assignment to gdb_stdtarg, which is not initialized anywhere else.
Diffstat (limited to 'gdb/event-top.c')
-rw-r--r--gdb/event-top.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/gdb/event-top.c b/gdb/event-top.c
index a5f24f6..1b522a7 100644
--- a/gdb/event-top.c
+++ b/gdb/event-top.c
@@ -1330,17 +1330,6 @@ gdb_setup_readline (int editing)
{
struct ui *ui = current_ui;
- /* This function is a noop for the sync case. The assumption is
- that the sync setup is ALL done in gdb_init, and we would only
- mess it up here. The sync stuff should really go away over
- time. */
- if (!batch_silent)
- gdb_stdout = new pager_file (new stdio_file (ui->outstream));
- gdb_stderr = new stderr_file (ui->errstream);
- gdb_stdlog = new timestamped_file (gdb_stderr);
- gdb_stdtarg = gdb_stderr;
- gdb_stdtargerr = gdb_stderr;
-
/* If the input stream is connected to a terminal, turn on editing.
However, that is only allowed on the main UI, as we can only have
one instance of readline. */