From 8dac2a541a0d6c5f486e73571d695fc663a3ca9a Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sun, 14 Feb 2016 00:56:52 +0100 Subject: [PATCH] change the semantics of EventLog "clearing" use the smart-ptr semantics to just detach from the log. This allows other entities still to hold onto a joined log --- src/lib/test/event-log.hpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/lib/test/event-log.hpp b/src/lib/test/event-log.hpp index 9c2aeac63..8e63f37e3 100644 --- a/src/lib/test/event-log.hpp +++ b/src/lib/test/event-log.hpp @@ -648,11 +648,18 @@ namespace test{ return this->clear (originalLogID); } - /** purge log contents and also reset Header-ID */ + /** purge log contents and also reset Header-ID + * @note actually we're starting a new log + * and let the previous one go away. + * @warning while this also unties any joined logs, + * other log front-ends might still hold onto + * the existing, combined log. Just we are + * detached and writing to a pristine log. + */ EventLog& clear (string alteredLogID) { - log_->clear(); + log_.reset (new Log); log({"type=EventLogHeader", "this="+alteredLogID}); return *this; }