fix(Any): set pHolder to nullptr in destruct()

This commit is contained in:
Matej Kenda 2024-12-11 17:20:44 +01:00
parent b380b57d5d
commit bc8704f44e

View File

@ -152,9 +152,16 @@ private:
if (!isEmpty()) if (!isEmpty())
{ {
if (!isLocal()) if (!isLocal())
delete pHolder; {
auto* h { pHolder };
pHolder = nullptr;
delete h;
}
else else
reinterpret_cast<PlaceholderT*>(holder)->~PlaceholderT(); {
auto* h { reinterpret_cast<PlaceholderT*>(holder) };
h->~PlaceholderT();
}
if (clear) std::memset(holder, 0, sizeof(holder)); if (clear) std::memset(holder, 0, sizeof(holder));
} }