[gtk+/gtk-2-24] Fixed gtk_entry_set_icon_tooltip_text & markup to not crash



commit 53ff5679f7331bc61fdea387e36513b63129894c
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date:   Fri Dec 17 18:15:08 2010 +0900

    Fixed gtk_entry_set_icon_tooltip_text & markup to not crash
    
    Setting this property before the icon is actually set was
    resulting in a crash (found by way of Glade bug 606103).

 gtk/gtkentry.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index 46b6d88..7f3de70 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -8423,8 +8423,8 @@ gtk_entry_set_icon_tooltip_text (GtkEntry             *entry,
 
   priv = GTK_ENTRY_GET_PRIVATE (entry);
 
-  if (!(icon_info = priv->icons[icon_pos]))
-    icon_info = priv->icons[icon_pos];
+  if ((icon_info = priv->icons[icon_pos]) == NULL)
+    icon_info = construct_icon_info (GTK_WIDGET (entry), icon_pos);
 
   if (icon_info->tooltip)
     g_free (icon_info->tooltip);
@@ -8502,8 +8502,8 @@ gtk_entry_set_icon_tooltip_markup (GtkEntry             *entry,
 
   priv = GTK_ENTRY_GET_PRIVATE (entry);
 
-  if (!(icon_info = priv->icons[icon_pos]))
-    icon_info = priv->icons[icon_pos];
+  if ((icon_info = priv->icons[icon_pos]) == NULL)
+    icon_info = construct_icon_info (GTK_WIDGET (entry), icon_pos);
 
   if (icon_info->tooltip)
     g_free (icon_info->tooltip);



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