From ded346905c16a8fbd5343701fda027ac87a0927f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrico=20Tr=C3=B6ger?= Date: Mon, 23 Mar 2009 00:58:33 +0100 Subject: [PATCH] Properly initialize tooltips instance to NULL --- midori/compat.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/midori/compat.c b/midori/compat.c index 6e858f55..273935e4 100644 --- a/midori/compat.c +++ b/midori/compat.c @@ -41,10 +41,13 @@ void gtk_widget_set_tooltip_text (GtkWidget* widget, const gchar* text) { - static GtkTooltips* tooltips; - if (!tooltips) - tooltips = gtk_tooltips_new (); - gtk_tooltips_set_tip (tooltips, widget, text, NULL); + if (text && *text) + { + static GtkTooltips* tooltips = NULL; + if (G_UNLIKELY (!tooltips)) + tooltips = gtk_tooltips_new (); + gtk_tooltips_set_tip (tooltips, widget, text, NULL); + } } void