From bd6c90b65dee342b7f0d12d98b21cab1b0e76795 Mon Sep 17 00:00:00 2001 From: Sasha Szpakowski Date: Mon, 9 Dec 2024 18:32:17 -0400 Subject: [PATCH] Fix a memory leak in TextBatch:add when the internal buffer is resized --- src/modules/graphics/TextBatch.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/graphics/TextBatch.cpp b/src/modules/graphics/TextBatch.cpp index de4c65872..3d47b8340 100644 --- a/src/modules/graphics/TextBatch.cpp +++ b/src/modules/graphics/TextBatch.cpp @@ -65,7 +65,8 @@ void TextBatch::uploadVertices(const std::vector &vertices, s Buffer::Settings settings(BUFFERUSAGEFLAG_VERTEX, BUFFERDATAUSAGE_DYNAMIC); auto decl = Buffer::getCommonFormatDeclaration(Font::vertexFormat); - Buffer *newbuffer = gfx->newBuffer(settings, decl, nullptr, newsize, 0); + + StrongRef newbuffer(gfx->newBuffer(settings, decl, nullptr, newsize, 0), Acquire::NORETAIN); void *newdata = nullptr; if (vertexData != nullptr)