diff options
author | worktycho <work.tycho@gmail.com> | 2017-04-01 17:28:42 +0200 |
---|---|---|
committer | Lukas Pioch <lukas@zgow.de> | 2017-06-03 21:40:35 +0200 |
commit | 832298e7aaee884393d8f80e5a374fa652b4cb68 (patch) | |
tree | 9b5c7af3b909f4a3616cfc1b32b36722f434ae60 /src/Logger.h | |
parent | Fixed double chests (#3741) (diff) | |
download | cuberite-832298e7aaee884393d8f80e5a374fa652b4cb68.tar cuberite-832298e7aaee884393d8f80e5a374fa652b4cb68.tar.gz cuberite-832298e7aaee884393d8f80e5a374fa652b4cb68.tar.bz2 cuberite-832298e7aaee884393d8f80e5a374fa652b4cb68.tar.lz cuberite-832298e7aaee884393d8f80e5a374fa652b4cb68.tar.xz cuberite-832298e7aaee884393d8f80e5a374fa652b4cb68.tar.zst cuberite-832298e7aaee884393d8f80e5a374fa652b4cb68.zip |
Diffstat (limited to '')
-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: |