mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-19 13:47:56 +00:00
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.
This commit is contained in:
parent
57fdce0465
commit
4c45f3451c
@ -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; }
|
||||
|
Loading…
Reference in New Issue
Block a user