Properly initialize tooltips instance to NULL
This commit is contained in:
parent
5c9e56fdb6
commit
ded346905c
1 changed files with 7 additions and 4 deletions
|
@ -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)
|
{
|
||||||
|
static GtkTooltips* tooltips = NULL;
|
||||||
|
if (G_UNLIKELY (!tooltips))
|
||||||
tooltips = gtk_tooltips_new ();
|
tooltips = gtk_tooltips_new ();
|
||||||
gtk_tooltips_set_tip (tooltips, widget, text, NULL);
|
gtk_tooltips_set_tip (tooltips, widget, text, NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in a new issue