Entry: Fix leak of text in ensure_has_tooltip()

Thanks to Mohammed Sadiq for noticing this. I guess I got
Widget.get_tooltip_text() confused with Label.get_label().

https://bugzilla.gnome.org/show_bug.cgi?id=787410
This commit is contained in:
Daniel Boles
2017-09-07 14:53:59 +01:00
parent 80e3239033
commit 09d1d5a0d6

View File

@@ -8127,7 +8127,8 @@ gtk_entry_get_icon_area (GtkEntry *entry,
static void
ensure_has_tooltip (GtkEntry *entry)
{
gboolean has_tooltip = gtk_widget_get_tooltip_text (GTK_WIDGET (entry)) != NULL;
gchar *text = gtk_widget_get_tooltip_text (GTK_WIDGET (entry));
gboolean has_tooltip = text != NULL;
if (!has_tooltip)
{
@@ -8145,6 +8146,10 @@ ensure_has_tooltip (GtkEntry *entry)
}
}
}
else
{
g_free (text);
}
gtk_widget_set_has_tooltip (GTK_WIDGET (entry), has_tooltip);
}