Fix destruction of basic_headers elements:

* Add missing call to destroy
* Use traits to destroy the element
This commit is contained in:
seelabs
2016-05-04 14:22:58 -04:00
committed by Vinnie Falco
parent 9a3a42a644
commit 43a81ff1a7

View File

@@ -59,7 +59,7 @@ delete_all()
for(auto it = list_.begin(); it != list_.end();)
{
auto& e = *it++;
e.~element();
alloc_traits::destroy(this->member(), &e);
alloc_traits::deallocate(
this->member(), &e, 1);
}
@@ -252,6 +252,7 @@ erase(boost::string_ref const& name)
auto& e = *it;
set_.erase(set_.iterator_to(e));
list_.erase(list_.iterator_to(e));
alloc_traits::destroy(this->member(), &e);
alloc_traits::deallocate(this->member(), &e, 1);
return 1;
}