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:
Norman Feske 2020-01-24 20:59:17 +01:00 committed by Christian Helmuth
parent 7da3404bd0
commit 844af06782

View File

@ -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 */