diff options
Diffstat (limited to 'libbutl/diagnostics.cxx')
-rw-r--r-- | libbutl/diagnostics.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libbutl/diagnostics.cxx b/libbutl/diagnostics.cxx index f574fd6..3254e27 100644 --- a/libbutl/diagnostics.cxx +++ b/libbutl/diagnostics.cxx @@ -157,14 +157,14 @@ namespace butl void (*diag_record::writer) (const diag_record&) = &default_writer; void diag_record:: - flush () const + flush (void (*w) (const diag_record&)) const { if (!empty_) { if (epilogue_ == nullptr) { - if (writer != nullptr) - writer (*this); + if (w != nullptr || (w = writer) != nullptr) + w (*this); empty_ = true; } @@ -174,8 +174,8 @@ namespace butl // auto e (epilogue_); epilogue_ = nullptr; - e (*this); // Can throw. - flush (); // Call ourselves to write the data in case it returns. + e (*this); // Can throw. @@ TODO: pass writer. + flush (w); // Call ourselves to write the data in case it returns. } } } |