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)