[Spice-devel] [PATCH spice-gtk] Remove g_object_{set, get}_data() usage

Hans de Goede hdegoede at redhat.com
Mon Nov 7 07:04:55 PST 2011


Hi,

On 11/07/2011 03:55 PM, Marc-André Lureau wrote:
> Hi
>
>> AFAIK you may only call g_clear_object on non NULL GObject pointers,
>> and if the matching foo_get was never called, it will be NULL, so
>> I believe this should be:
>>
>>       if (s->audio_manager)
>>           g_clear_object(&s->audio_manager);
>
> g_clear_object() doesn't want a NULL pointer (to a pointer of GObject, NULL or no).
>
> See implementation: http://git.gnome.org/browse/glib/tree/gobject/gobject.c#n2785
>
> I think in general, all the g_clear_* functions handle it similarly.

I stand corrected, in that case ACK.

Regards,

Hans


More information about the Spice-devel mailing list