diff options
author | Matthias Clasen <mclasen@redhat.com> | 2022-06-24 19:28:14 +0000 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2022-06-24 19:28:14 +0000 |
commit | 739aaa7added866be3f30b7efb65e7c3453e9b38 (patch) | |
tree | 1d69a4ea6fd9b4a1d286a219f59a5aebfbc249a1 | |
parent | ab68cee0909292ca8db7b021eb31d04d4b99d001 (diff) | |
parent | 13174cd70d75c849bfa408f0f7fbde7e05f768c6 (diff) | |
download | gtk+-739aaa7added866be3f30b7efb65e7c3453e9b38.tar.gz |
Merge branch 'gtk-3-24' into 'gtk-3-24'
gtkmodifierstyle.c: Release symbolic color memory
See merge request GNOME/gtk!4830
-rw-r--r-- | gtk/gtkmodifierstyle.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/gtk/gtkmodifierstyle.c b/gtk/gtkmodifierstyle.c index 1ea54d120f..3092b6c347 100644 --- a/gtk/gtkmodifierstyle.c +++ b/gtk/gtkmodifierstyle.c @@ -226,16 +226,18 @@ _gtk_modifier_style_map_color (GtkModifierStyle *style, g_return_if_fail (GTK_IS_MODIFIER_STYLE (style)); g_return_if_fail (name != NULL); + g_return_if_fail (color != NULL); priv = style->priv; - if (color) - symbolic_color = gtk_symbolic_color_new_literal (color); - - gtk_style_properties_map_color (priv->style, - name, symbolic_color); - - _gtk_style_provider_private_changed (GTK_STYLE_PROVIDER_PRIVATE (style)); + symbolic_color = gtk_symbolic_color_new_literal (color); + if (symbolic_color) + { + gtk_style_properties_map_color (priv->style, + name, symbolic_color); + gtk_symbolic_color_unref (symbolic_color); + _gtk_style_provider_private_changed (GTK_STYLE_PROVIDER_PRIVATE (style)); + } } void |