[gtk+] cssnode: Don't leak the style cache on destruction
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] cssnode: Don't leak the style cache on destruction
- Date: Mon, 18 Jan 2016 17:07:22 +0000 (UTC)
commit e150ea85bb548afdf5724beed6e262fd2d8fa7b3
Author: Benjamin Otte <otte redhat com>
Date: Mon Jan 18 18:05:53 2016 +0100
cssnode: Don't leak the style cache on destruction
gtk/gtkcssnode.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkcssnode.c b/gtk/gtkcssnode.c
index aac0bb3..0a4c510 100644
--- a/gtk/gtkcssnode.c
+++ b/gtk/gtkcssnode.c
@@ -236,6 +236,8 @@ gtk_css_node_dispose (GObject *object)
}
gtk_css_node_set_invalid (cssnode, FALSE);
+
+ g_clear_pointer (&cssnode->cache, gtk_css_node_style_cache_unref);
G_OBJECT_CLASS (gtk_css_node_parent_class)->dispose (object);
}
@@ -314,6 +316,7 @@ lookup_in_global_parent_cache (GtkCssNode *node,
if (parent->cache == NULL)
return NULL;
+ g_assert (node->cache == NULL);
node->cache = gtk_css_node_style_cache_lookup (parent->cache,
(GtkCssNodeDeclaration *) decl,
gtk_css_node_is_first_child (node),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]