mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-22 06:57:51 +00:00
base/buffered_output.h: flush at destruction time
By writing out all dangling characters at destruction time, the 'Buffered_output' utility can be used as a local variable rather than a long-living object.
This commit is contained in:
parent
7da3404bd0
commit
844af06782
@ -52,6 +52,8 @@ class Genode::Buffered_output : public Output
|
||||
|
||||
Buffered_output(BACKEND_WRITE_FN const &write_fn) : _write_fn(write_fn) { }
|
||||
|
||||
~Buffered_output() { _flush(); }
|
||||
|
||||
void out_char(char c) override
|
||||
{
|
||||
/* ensure enough buffer space for complete escape sequence */
|
||||
|
Loading…
Reference in New Issue
Block a user