mirror of
https://github.com/love2d/love.git
synced 2026-08-19 12:14:20 +02:00
Fix a memory leak in TextBatch:add when the internal buffer is resized
This commit is contained in:
@@ -65,7 +65,8 @@ void TextBatch::uploadVertices(const std::vector<Font::GlyphVertex> &vertices, s
|
|||||||
|
|
||||||
Buffer::Settings settings(BUFFERUSAGEFLAG_VERTEX, BUFFERDATAUSAGE_DYNAMIC);
|
Buffer::Settings settings(BUFFERUSAGEFLAG_VERTEX, BUFFERDATAUSAGE_DYNAMIC);
|
||||||
auto decl = Buffer::getCommonFormatDeclaration(Font::vertexFormat);
|
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;
|
void *newdata = nullptr;
|
||||||
if (vertexData != nullptr)
|
if (vertexData != nullptr)
|
||||||
|
|||||||
Reference in New Issue
Block a user