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, gtk_widget_set_tooltip_text (GtkWidget* widget,
const gchar* text) const gchar* text)
{ {
static GtkTooltips* tooltips; if (text && *text)
if (!tooltips) {
tooltips = gtk_tooltips_new (); static GtkTooltips* tooltips = NULL;
gtk_tooltips_set_tip (tooltips, widget, text, NULL); if (G_UNLIKELY (!tooltips))
tooltips = gtk_tooltips_new ();
gtk_tooltips_set_tip (tooltips, widget, text, NULL);
}
} }
void void