Re: [gnome-db] GObject question



Le ven 21/06/2002 à 18:21, Rodrigo Moya a écrit :
> On Fri, 2002-06-21 at 17:18, Malerba_Vivien stna dgac fr wrote:
> > 
> > > 
> > > I'm not sure there is another signal you could use to be notified before
> > > the object is destroyed.
> > 
> > I've made some tests and it looks like within the "dispose" method, the
> > ref_counter is still 1, so I assume the "dispose" method gets called
> > before the "finalize" method when an object is being free'd (this is
> > what I can see from the gobject.c file l.423). 
> > 
> > So I assume I can emit signals from within the "dispose" method, and the
> > I have quite a lot of modifications to be done on some objects.
> > 
> > Is there any way to make sure about that way of doing things?
> > 
> you want to notify when the object is destroyed? In that case, I guess
> the best thing is to just use weask references from the "client" (the
> objects to be notified of the destruction).

It' more than just a destruction notification: for example when a
DbTable object is destroyed, it emits a "field_dropped" for all the
fields in the table. I've made some tests with overriding the "dispose"
method, and it works fine.

Thanks,

Vivien



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