St: reference the StTheme from StThemeNode

This is a partial revert of 7eaf231e56,
which caused segfaults. For some reason, StThemeNodes seem to survive
style changes.
This commit is contained in:
Giovanni Campagna 2012-06-25 14:08:56 +02:00
parent de2dcfeb99
commit 1b8d03f945

View File

@ -85,6 +85,8 @@ st_theme_node_dispose (GObject *gobject)
node->icon_colors = NULL; node->icon_colors = NULL;
} }
g_clear_object (&node->theme);
G_OBJECT_CLASS (st_theme_node_parent_class)->dispose (gobject); G_OBJECT_CLASS (st_theme_node_parent_class)->dispose (gobject);
} }
@ -194,6 +196,9 @@ st_theme_node_new (StThemeContext *context,
if (theme != NULL) if (theme != NULL)
node->theme = theme; node->theme = theme;
if (node->theme != NULL)
g_object_ref (node->theme);
node->element_type = element_type; node->element_type = element_type;
node->element_id = g_strdup (element_id); node->element_id = g_strdup (element_id);
node->element_class = g_strdup (element_class); node->element_class = g_strdup (element_class);