fix(util/thread): thread_specific_ptr finalization

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2014-07-22 10:50:04 -07:00
parent a7c6c3e840
commit fd7e20f11c

View file

@ -166,7 +166,7 @@ public:
T * m_ptr;
public:
thread_specific_ptr():m_ptr(nullptr) {}
~thread_specific_ptr() { if (m_ptr) delete m_ptr; }
~thread_specific_ptr() { if (m_ptr) delete m_ptr; m_ptr = nullptr; }
T * get() const { return m_ptr; }
void reset(T * ptr) { if (m_ptr) delete m_ptr; m_ptr = ptr; }
T * operator->() const { return m_ptr; }