diff --git a/libcxx/include/vector b/libcxx/include/vector --- a/libcxx/include/vector +++ b/libcxx/include/vector @@ -439,11 +439,11 @@ _LIBCPP_CONSTEXPR __destroy_vector(vector& __vec) : __vec_(__vec) {} _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI void operator()() { - __vec_.__annotate_delete(); std::__debug_db_erase_c(std::addressof(__vec_)); if (__vec_.__begin_ != nullptr) { __vec_.__clear(); + __vec_.__annotate_delete(); __alloc_traits::deallocate(__vec_.__alloc(), __vec_.__begin_, __vec_.capacity()); } } @@ -866,6 +866,7 @@ if (__alloc() != __c.__alloc()) { __clear(); + __annotate_delete(); __alloc_traits::deallocate(__alloc(), this->__begin_, capacity()); this->__begin_ = this->__end_ = __end_cap() = nullptr; } @@ -954,6 +955,7 @@ if (this->__begin_ != nullptr) { clear(); + __annotate_delete(); __alloc_traits::deallocate(this->__alloc(), this->__begin_, capacity()); this->__begin_ = this->__end_ = this->__end_cap() = nullptr; }