From b828f3b2001f48e7fd3f0db68ce1dadcd323ce84 Mon Sep 17 00:00:00 2001 From: Brett Laptop Date: Thu, 25 Jan 2024 10:00:56 -0500 Subject: [PATCH] destory now checks for null --- include/blt/std/allocator.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/blt/std/allocator.h b/include/blt/std/allocator.h index 3b5bfa5..2efbdc3 100644 --- a/include/blt/std/allocator.h +++ b/include/blt/std/allocator.h @@ -231,7 +231,8 @@ namespace blt template inline void destroy(U* p) { - p->~U(); + if (p) + p->~U(); } [[nodiscard]] inline size_t max_size() const