Skip to content

Commit

Permalink
Fix a memory leak in TextBatch:add when the internal buffer is resized
Browse files Browse the repository at this point in the history
  • Loading branch information
slime73 committed Dec 9, 2024
1 parent 90b52df commit bd6c90b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/modules/graphics/TextBatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ void TextBatch::uploadVertices(const std::vector<Font::GlyphVertex> &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<Buffer> newbuffer(gfx->newBuffer(settings, decl, nullptr, newsize, 0), Acquire::NORETAIN);

void *newdata = nullptr;
if (vertexData != nullptr)
Expand Down

0 comments on commit bd6c90b

Please sign in to comment.