[gnome-shell] st-theme-node: Don't hold a ref to the theme context or the theme



commit 7eaf231e566e8a8470589e743bac10475c1ce987
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Sun Jun 24 02:26:39 2012 -0400

    st-theme-node: Don't hold a ref to the theme context or the theme
    
    This would just be a circular reference, which we need to avoid.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=678737

 src/st/st-theme-node.c |   16 ++--------------
 1 files changed, 2 insertions(+), 14 deletions(-)
---
diff --git a/src/st/st-theme-node.c b/src/st/st-theme-node.c
index 765a3ee..27a59f1 100644
--- a/src/st/st-theme-node.c
+++ b/src/st/st-theme-node.c
@@ -67,18 +67,6 @@ st_theme_node_dispose (GObject *gobject)
 {
   StThemeNode *node = ST_THEME_NODE (gobject);
 
-  if (node->context)
-    {
-      g_object_unref (node->context);
-      node->context = NULL;
-    }
-
-  if (node->theme)
-    {
-      g_object_unref (node->theme);
-      node->theme = NULL;
-    }
-
   if (node->parent_node)
     {
       g_object_unref (node->parent_node);
@@ -194,7 +182,7 @@ st_theme_node_new (StThemeContext    *context,
 
   node = g_object_new (ST_TYPE_THEME_NODE, NULL);
 
-  node->context = g_object_ref (context);
+  node->context = context;
   if (parent_node != NULL)
     node->parent_node = g_object_ref (parent_node);
   else
@@ -204,7 +192,7 @@ st_theme_node_new (StThemeContext    *context,
     theme = parent_node->theme;
 
   if (theme != NULL)
-    node->theme = g_object_ref (theme);
+    node->theme = theme;
 
   node->element_type = element_type;
   node->element_id = g_strdup (element_id);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]