fix(util/thread): thread_specific_ptr finalization
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
a7c6c3e840
commit
fd7e20f11c
1 changed files with 1 additions and 1 deletions
|
@ -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; }
|
||||
|
|
Loading…
Reference in a new issue