From 2b141965f2ddef8cf3e79d357768a98c8703a5df Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Thu, 17 Nov 2022 09:09:59 -0700 Subject: Don't let tee_file own a stream Right now, tee_file owns the second stream it writes to. This is done for the convenience of the users. In a subsequent patch, this will no longer be convenient, so this patch moves the responsibility for ownership to the users of tee_file. --- gdb/ui-file.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'gdb/ui-file.h') diff --git a/gdb/ui-file.h b/gdb/ui-file.h index e33ae79..4a006bb 100644 --- a/gdb/ui-file.h +++ b/gdb/ui-file.h @@ -329,9 +329,9 @@ public: class tee_file : public ui_file { public: - /* Create a file which writes to both ONE and TWO. ONE will remain - open when this object is destroyed; but TWO will be closed. */ - tee_file (ui_file *one, ui_file_up &&two); + /* Create a file which writes to both ONE and TWO. Ownership of + both files is up to the user. */ + tee_file (ui_file *one, ui_file *two); ~tee_file () override; void write (const char *buf, long length_buf) override; @@ -364,7 +364,7 @@ public: private: /* The two underlying ui_files. */ ui_file *m_one; - ui_file_up m_two; + ui_file *m_two; }; /* A ui_file implementation that filters out terminal escape -- cgit v1.1