From: Enrico Tröger Date: Sun, 22 Mar 2009 23:58:33 +0000 (+0100) Subject: Properly initialize tooltips instance to NULL X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ded346905c16a8fbd5343701fda027ac87a0927f;p=midori Properly initialize tooltips instance to NULL --- 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