Is this meant to happen? (was Re: commit: AbiWord is now a Nautilus View.



On Sun, 30 Mar 2003, Jens Finke wrote:

> Hi,
> 
> On Sun, 30 Mar 2003, Martin Sevior wrote:
> > I've tried overriding destroy functions in the abiwidget control and 
> > connecting to the "destroy" and "delete_event" events. Nothing ever seems 
> > to get called. Reading through the EOG code implies that merely overiding 
> > the destroy functions should work. But it didn't for me.
> > 
> > I'll look into the nautilus-adapter code to see if there is some clue as 
> > to what signal it gives the control when it disconnects.
> > 
> > Thanks for your help Jason.
> 
> my experience is, that in most cases you have some hanging remote
> BonoboObject references in your control. We had this problem in the eog
> lifecycle too, and fixed this by looking through the code carefully and
> make sure everything is unref'ed/free'ed correctly. Nautilus will unref
> the component when it's no longer used. But if the component has some
> references to remote BonoboObjects yet the whole component won't be shut
> down by the bonobo framework.
> 

Hi Jens,
	Thanks VERY much for this tip. I sprinkled debug msgs throughout
the code to print out the reference number of the bonobo control and it's
lying widget. I disovered that after closing the abiword frame I was left
with a reference count of 1 for the widget.

Further investigation led me to this...

I put in this code..

#ifdef LOGFILE 
fprintf(logfile," Just before bonobo_control_new ref count %d 
\n",G_OBJECT(abi)->ref_count); 
#endif 

BonoboControl * control = bonobo_control_new (GTK_WIDGET(abi)); 
#ifdef LOGFILE 
fprintf(logfile,"Just after bonobo_control_new ref count %d \n",
G_OBJECT(control)->ref_count);

#endif

I get..
Just before bonobo_control_new ref count 1
 Just after bonobo_control_new ref count 3

ie doing the bonobo_control_new(GTK_WIDGET(abi))

increments the reference count by 2.

Furthermore I get the desired behaviour of the destroy methods getting 
called upon closing the nautilus view if I do:

g_object_unref(abi)

Is this what is meant to happen?

Puzzled.

Martin








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