diff --git a/src/modules/graphics/Text.cpp b/src/modules/graphics/Text.cpp index 3b3d54d57..8d3fa6dd5 100644 --- a/src/modules/graphics/Text.cpp +++ b/src/modules/graphics/Text.cpp @@ -33,7 +33,6 @@ love::Type Text::type("Text", &Drawable::type); Text::Text(Font *font, const std::vector &text) : font(font) , vertexAttributes(Font::vertexFormat, 0) - , vertex_buffer(nullptr) , vert_offset(0) , texture_cache_id((uint32) -1) { @@ -42,8 +41,6 @@ Text::Text(Font *font, const std::vector &text) Text::~Text() { - if (vertex_buffer) - vertex_buffer->release(); } void Text::uploadVertices(const std::vector &vertices, size_t vertoffset) @@ -68,7 +65,6 @@ void Text::uploadVertices(const std::vector &vertices, size_t if (vertex_buffer != nullptr) vertex_buffer->copyTo(0, vertex_buffer->getSize(), new_buffer, 0); - vertex_buffer->release(); vertex_buffer = new_buffer; vertexBuffers.set(0, vertex_buffer, 0); diff --git a/src/modules/graphics/Text.h b/src/modules/graphics/Text.h index 0e3259919..ca55ec44e 100644 --- a/src/modules/graphics/Text.h +++ b/src/modules/graphics/Text.h @@ -88,7 +88,7 @@ private: VertexAttributes vertexAttributes; BufferBindings vertexBuffers; - Buffer *vertex_buffer; + StrongRef vertex_buffer; std::vector draw_commands;