Properly initialize tooltips instance to NULL

This commit is contained in:
Enrico Tröger 2009-03-23 00:58:33 +01:00 committed by Christian Dywan
parent 5c9e56fdb6
commit ded346905c

View file

@ -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