glyphcache: Don't leak hashtables

This commit is contained in:
Timm Bäder 2019-06-03 16:47:58 +02:00
parent 05ca772631
commit 3a49c0eb2f

View File

@ -386,14 +386,15 @@ gsk_gl_glyph_cache_begin_frame (GskGLGlyphCache *self)
GHashTableIter iter; GHashTableIter iter;
GlyphCacheKey *key; GlyphCacheKey *key;
GskGLCachedGlyph *value; GskGLCachedGlyph *value;
GHashTable *removed = g_hash_table_new (g_direct_hash, g_direct_equal); GHashTable *removed;
self->timestamp++; self->timestamp++;
if ((self->timestamp - 1) % CHECK_INTERVAL != 0) if ((self->timestamp - 1) % CHECK_INTERVAL != 0)
return; return;
removed = g_hash_table_new (g_direct_hash, g_direct_equal);
/* look for glyphs that have grown old since last time */ /* look for glyphs that have grown old since last time */
g_hash_table_iter_init (&iter, self->hash_table); g_hash_table_iter_init (&iter, self->hash_table);
while (g_hash_table_iter_next (&iter, (gpointer *)&key, (gpointer *)&value)) while (g_hash_table_iter_next (&iter, (gpointer *)&key, (gpointer *)&value))