From 4c45f3451c6facc99c0e2955d9cb37be5ac55b4d Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Fri, 14 Feb 2014 20:39:15 +0100 Subject: [PATCH] os/reporter.h: Don't enable if connection fails If opening a report session fails (for example because of invalid session arguments) and an exception is thrown during the session construction, the report would wrongly keep the enabled state. By moving the assignment of the state after the construction, the report stays disabled as it should be. --- os/include/os/reporter.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/os/include/os/reporter.h b/os/include/os/reporter.h index 3ea5d0081f..5b647ccae1 100644 --- a/os/include/os/reporter.h +++ b/os/include/os/reporter.h @@ -52,12 +52,12 @@ class Genode::Reporter : Noncopyable { if (enabled == _enabled) return; - _enabled = enabled; - - if (_enabled) + if (enabled) _conn.construct(_name.string()); else _conn.destruct(); + + _enabled = enabled; } bool is_enabled() const { return _enabled; }