Fix memory leak in the C++ SharedVector

detaching in the destructor is not a good idea, make sure to use the const version
This commit is contained in:
Olivier Goffart 2021-11-26 15:00:44 +01:00
parent cba553b9f7
commit d9637816bb

View file

@ -175,7 +175,7 @@ private:
void drop()
{
if (inner->refcount > 0 && (--inner->refcount) == 0) {
auto b = begin(), e = end();
auto b = cbegin(), e = cend();
for (auto it = b; it < e; ++it) {
it->~T();
}