Re: [Bluez-devel] [PATCH] Make BluetoothClient work on all adapters

Marcel Holtmann
2007-07-24T21:26:23Z

Hi Bastien,

> > > > With this patch, we can now pass a NULL as the adapter to work with all
> > > > the adapters. This is for use in the upcoming patch for the selector
> > > > widget.
> > >
> > > And a tiny patch to fix the test-client's compilation.
> >
> > what is wrong with providing a convenience wrapper around the GObject
> > unref function?
>
> unref isn't destroy.
>
> Destroy, as used in GTK+ for widgets (it's not used in glib) means you
> destroy the widget, drop the refcount to 0, clean up, free the memory,
> etc.
>
> Unref means you reduce the refcount by 1. If you have > 1 reference
> before running the command, then nothing happens apart from the refcount
> being updates.
>
> Wrapping a _destroy() function to call _unref() means you're mixing two
> semantics. When you call _destroy() the object isn't destroyed, it's
> refcount is reduced...

okay. Point taken. I removed the _destroy() function form the code, but
I didn't apply the rest of the patch.