[gtk] glyphcache: Don't leak hashtables
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk] glyphcache: Don't leak hashtables
- Date: Mon, 3 Jun 2019 15:03:39 +0000 (UTC)
commit 3a49c0eb2f1520d7f9e1e89aab200aa51b0734b9
Author: Timm Bäder <mail baedert org>
Date: Mon Jun 3 16:47:58 2019 +0200
glyphcache: Don't leak hashtables
gsk/gl/gskglglyphcache.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gsk/gl/gskglglyphcache.c b/gsk/gl/gskglglyphcache.c
index 7e01b2bbd9..28cb9063e2 100644
--- a/gsk/gl/gskglglyphcache.c
+++ b/gsk/gl/gskglglyphcache.c
@@ -386,14 +386,15 @@ gsk_gl_glyph_cache_begin_frame (GskGLGlyphCache *self)
GHashTableIter iter;
GlyphCacheKey *key;
GskGLCachedGlyph *value;
- GHashTable *removed = g_hash_table_new (g_direct_hash, g_direct_equal);
+ GHashTable *removed;
self->timestamp++;
-
if ((self->timestamp - 1) % CHECK_INTERVAL != 0)
return;
+ removed = g_hash_table_new (g_direct_hash, g_direct_equal);
+
/* look for glyphs that have grown old since last time */
g_hash_table_iter_init (&iter, self->hash_table);
while (g_hash_table_iter_next (&iter, (gpointer *)&key, (gpointer *)&value))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]