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

Tiziano Müller tiziano.mueller at stepping-stone.ch
Mon Nov 7 07:01:33 PST 2011


Am Montag, den 07.11.2011, 15:43 +0100 schrieb Hans de Goede:
> 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);
>      if (s->gtk_session)
>          g_clear_object(&s->gtk_session);
>      if (s->usb_manager)
>          g_clear_object(&s->usb_manager);
> 

If I understand
http://developer.gnome.org/gobject/stable/gobject-The-Base-Object-Type.html#g-clear-object correctly, object_ptr must not be null (for example &s->audio_manager), but the reference itself (for example s->audio_manager) may be NULL in which case the function g_clear_object does nothing.

Cheers,
Tiziano

-- 
stepping stone GmbH
Neufeldstrasse 9
CH-3012 Bern

Telefon: +41 31 332 53 63
www.stepping-stone.ch
tiziano.mueller at stepping-stone.ch



More information about the Spice-devel mailing list