missing ifdef for g_object_ref_sink call

Stu Tomlinson stu at nosnilmot.com
Sat Jun 21 11:49:32 EDT 2008


On Sat, 2008-06-21 at 17:33 +0200, Andrea Visinoni wrote:
> --- pidgin/gtkmenutray.c        379e9d48d2bb7d9a67fe6927cccdab5263f55971
> +++ pidgin/gtkmenutray.c        c4af27d6a7547ba2eb2b37be6b0e7feb47b2c20d
> @@ -99,8 +99,12 @@ pidgin_menu_tray_finalize(GObject *obj)
>   #endif
> 
>          if (tray->tooltips)
> +#if GLIB_CHECK_VERSION(2,10,0)
>                  g_object_ref_sink(G_OBJECT(tray->tooltips));
> -
> +#else
> +        g_object_ref(G_OBJECT(tray->tooltips));
> +        gtk_object_sink(GTK_OBJECT(G_OBJECT(tray->tooltips)));
> +#endif
>          G_OBJECT_CLASS(parent_class)->finalize(obj);
>   }

This needs extra curly braces, or the if (tray->tooltips) will only
apply to g_object_ref() and gtk_object_sink() will be called
unconditionally on glib < 2.10.0

Regards,


Stu.




More information about the Devel mailing list