mirror of https://github.com/bjornbytes/lovr.git
Properly release glyph TextureData;
This commit is contained in:
parent
ae4f0e1e6c
commit
abd1c75140
|
@ -58,6 +58,12 @@ void lovrFontDestroy(void* ref) {
|
|||
Font* font = ref;
|
||||
lovrRelease(font->rasterizer);
|
||||
lovrRelease(font->texture);
|
||||
const char* key;
|
||||
map_iter_t iter = map_iter(&font->atlas.glyphs);
|
||||
while ((key = map_next(&font->atlas.glyphs, &iter)) != NULL) {
|
||||
Glyph* glyph = map_get(&font->atlas.glyphs, key);
|
||||
lovrRelease(glyph->data);
|
||||
}
|
||||
map_deinit(&font->atlas.glyphs);
|
||||
map_deinit(&font->kerning);
|
||||
free(font);
|
||||
|
@ -320,8 +326,7 @@ void lovrFontCreateTexture(Font* font) {
|
|||
}
|
||||
|
||||
TextureData* textureData = lovrTextureDataGetBlank(font->atlas.width, font->atlas.height, 0x0, FORMAT_RGB);
|
||||
TextureFilter filter = { .mode = FILTER_BILINEAR };
|
||||
font->texture = lovrTextureCreate(TEXTURE_2D, &textureData, 1, false, false);
|
||||
lovrTextureSetFilter(font->texture, filter);
|
||||
lovrTextureSetFilter(font->texture, (TextureFilter) { .mode = FILTER_BILINEAR });
|
||||
lovrTextureSetWrap(font->texture, (TextureWrap) { .s = WRAP_CLAMP, .t = WRAP_CLAMP });
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue