From 1d8f9b4bbdb84647c8a96b1ef87d262afd7021cb Mon Sep 17 00:00:00 2001 From: Brett Laptop Date: Fri, 27 Oct 2023 14:32:15 -0400 Subject: [PATCH] fix memory leak --- include/blt/std/memory.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/blt/std/memory.h b/include/blt/std/memory.h index 7a24b5c..33241ec 100755 --- a/include/blt/std/memory.h +++ b/include/blt/std/memory.h @@ -186,6 +186,7 @@ namespace blt scoped_buffer(scoped_buffer&& move) noexcept { + delete[] _buffer; _buffer = move._buffer; _size = move.size(); move._buffer = nullptr; @@ -195,6 +196,7 @@ namespace blt scoped_buffer& operator=(scoped_buffer&& moveAssignment) noexcept { + delete[] _buffer; _buffer = moveAssignment._buffer; _size = moveAssignment.size(); moveAssignment._buffer = nullptr;