From 09c909567c06f93bfe8c00e247a7e565f13672cd Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Wed, 6 Nov 2024 12:38:20 -0500 Subject: [PATCH] AllocTyped fix when leak check is disabled --- BeefLibs/corlib/src/BumpAllocator.bf | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/BeefLibs/corlib/src/BumpAllocator.bf b/BeefLibs/corlib/src/BumpAllocator.bf index d2f91889..8cffb8c3 100644 --- a/BeefLibs/corlib/src/BumpAllocator.bf +++ b/BeefLibs/corlib/src/BumpAllocator.bf @@ -259,6 +259,18 @@ namespace System } } } +#else + public void* AllocTyped(Type type, int size, int align) + { + if ((DestructorHandling != .Ignore) && (type.HasDestructor)) + { + if (DestructorHandling == .Fail) + Runtime.FatalError("Destructor not allowed"); + return AllocWithDtor(size, align); + } + + return Alloc(size, align); + } #endif [SkipCall]