mirror of
https://github.com/boostorg/beast.git
synced 2025-08-01 05:44:38 +02:00
Fix destruction of basic_headers elements:
* Add missing call to destroy * Use traits to destroy the element
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user