Skip to content

Commit 59b37f3

Browse files
authored
Call variant destructor (#796)
1 parent ad44f4a commit 59b37f3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/variant_allocator.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ class VariantAllocator {
6060
// Trigger compile-time error if T is larger than 16 bytes
6161
static_assert(sizeof(T) <= sizeof(BucketLarge), "Variant doesn't fit inside the VariantAllocator");
6262

63+
variant->~T();
6364
if constexpr (sizeof(T) <= sizeof(BucketSmall)) {
6465
bucket_small.free(reinterpret_cast<BucketSmall*>(variant));
6566
} else {

0 commit comments

Comments
 (0)