Fix a memory leak in TextBatch:add when the internal buffer is resized

This commit is contained in:
Sasha Szpakowski
2024-12-09 18:32:17 -04:00
parent 90b52df955
commit bd6c90b65d
+2 -1
View File
@@ -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)