[gtk+/gtk-3-22] Entry: Fix leak of text in ensure_has_tooltip()
- From: Daniel Boles <dboles src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-22] Entry: Fix leak of text in ensure_has_tooltip()
- Date: Thu, 7 Sep 2017 14:00:47 +0000 (UTC)
commit 660cc709fc546f7118fda189779e3a04a291934d
Author: Daniel Boles <dboles src gnome org>
Date: Thu Sep 7 14:53:59 2017 +0100
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
gtk/gtkentry.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index 2ee6931..d97b6e9 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -9192,7 +9192,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)
{
@@ -9210,6 +9211,10 @@ ensure_has_tooltip (GtkEntry *entry)
}
}
}
+ else
+ {
+ g_free (text);
+ }
gtk_widget_set_has_tooltip (GTK_WIDGET (entry), has_tooltip);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]