diff options
Diffstat (limited to 'src/Logger.h')
-rw-r--r-- | src/Logger.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/Logger.h b/src/Logger.h index 649c11ded..b4bf97cd6 100644 --- a/src/Logger.h +++ b/src/Logger.h @@ -27,14 +27,26 @@ public: { public: + cAttachment() : m_listener(nullptr) {} cAttachment(cAttachment && a_other) : m_listener(a_other.m_listener) { + a_other.m_listener = nullptr; } ~cAttachment() { - cLogger::GetInstance().DetachListener(m_listener); + if (m_listener != nullptr) + { + cLogger::GetInstance().DetachListener(m_listener); + } + } + + cAttachment & operator=(cAttachment && a_other) + { + m_listener = a_other.m_listener; + a_other.m_listener = nullptr; + return *this; } private: |