Re: GNOME CVS: libbonobo michael
- From: jacob berkman <jacob ximian com>
- To: Havoc Pennington <hp redhat com>
- Cc: Michael Meeks <michael ximian com>, gnome-components-list gnome org
- Subject: Re: GNOME CVS: libbonobo michael
- Date: 31 Oct 2001 18:21:42 -0500
On Wed, 2001-10-31 at 18:11, Havoc Pennington wrote:
>
> > bonobo_control_set_pb (control, pb)
> > {
> > if (control->pb == pb)
> > return;
> >
> > bonobo_object_unref (control->pb);
> > control->pb = bonobo_object_ref (pb);
> > }
> >
> > Which is more lucid, and less prone to people forgetting the NULL
> > path to set the value to NULL.
>
> I usually write:
>
> bonobo_control_set_pb (control, pb)
> {
> if (pb)
> bonobo_object_ref (pb);
>
> if (control->pb)
> bonobo_object_unref (control->pb);
>
> control->pb = pb;
> }
>
> Which is just as short, and clarifies that either control->pb or pb
> could be NULL.
and this doesn't make BonoboObject and GObject behave differently wrt
ref/unref of NULL objects (which i really this is a horrible idea, hence
my replying to the commit).
jacob
--
"Beat mixing is 10000 times more fun than even video games."
-- bt
[
Date Prev][Date Next] [
Thread Prev][Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]