Commit 5a9be2c6 authored by Feng Xiao's avatar Feng Xiao

Fix MapAllocator::destroy() bug.

destroy() should always call the destructor because the caller may rely on
the destructor to do clean-ups.
parent 802e1848
...@@ -176,14 +176,12 @@ class Map { ...@@ -176,14 +176,12 @@ class Map {
template<class NodeType> template<class NodeType>
void destroy(NodeType* p) { void destroy(NodeType* p) {
if (arena_ == NULL) p->~NodeType(); p->~NodeType();
} }
#else #else
void construct(pointer p, const_reference t) { new (p) value_type(t); } void construct(pointer p, const_reference t) { new (p) value_type(t); }
void destroy(pointer p) { void destroy(pointer p) { p->~value_type(); }
if (arena_ == NULL) p->~value_type();
}
#endif #endif
template <typename X> template <typename X>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment