Re: BonoboControl refcounting



El lun, 05-08-2002 a las 09:37, Michael Meeks escribió:
> Hi Ricardo,
> 
> On Fri, 2002-08-02 at 12:20, Ricardo Fernández Pascual wrote:
> >     I was trying to figure why galeon was leaking widgets in its toolbar
> > code, and I think that I've found a problem with the way BonoboControl
> > refcounting is done:
> ...
> > In bonobo_control_init, create plug is called ...
> 
> 	the ref counting is relatively complicated between BonoboControl and
> BonoboPlug, see libbonoboui/doc/control.txt. I forget the precise
> details, but I'm hesitant to go chasing in there.

It's really complicated ;)
When I first saw libbonoboui/doc/control.txt I thought it was just some
implementation notes and didn't read it. It does not look like a must
read doc...

A simple doc explaining how to use the bonobo_object_ref/unref alongside
g_object/ref/unref would be very useful IMHO, currently it's quite hard
to know what happens.

> 
> > If I'm wrong, how am I supposed to manage the life cycle of bonobo
> > controls?
> 
> 	Are you certain that you unref your BonoboControl after adding it to
> the UIContainer:
> 
> 	bonobo_ui_component_object_set (
> 		uic, "/foo", BONOBO_OBJREF (ctl), NULL);
> !!!	bonobo_object_unref (ctl);
> 

No, I was not doing this. I had tried doing a g_object_unref here (it
didn't work, of course). Thank you, it seems that things work correctly
now.

Ricardo.


-- 
Ricardo Fernández Pascual
ric users sourceforge net
Murcia. España.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]