Re: ActivationContext and shlib servers



Michael Meeks <michael ximian com> writes:

> On Sat, 27 Jan 2001, Michael Meeks wrote:
> > On Sat, 27 Jan 2001, Michael Meeks wrote:
> > > 	It should be safe as long as you have no instance init function
> > > ( fairly common practice ) and that you build a gtk_type_query into
> > > your whatever_get_type () method.
> > 
> > 	This is totaly wrong :-) I was not thinking straight.
> 
> 	Although; in fact with a helper function, if they type was
> registered when you hit the query you could re-init the class data with
> the class_init function thus solving any remaining problems. Of course if
> you were doing very broken stuff you could still scupper yourself by
> accessing a broken GtkType, but this seems unlikely.

I don't think that will work. The GtkType contains pointers into your
code besides the data created by the class_init function (for
instance, a pointer to a class_init function which may well have been
unloaded and then reloaded at a new location).

> 
> 	So, I still think we can work around this fairly easily.
> 

If you come up with a workaround you think works, I'd love to hear
about it. Owen and Havoc both say it is impossible and I tend to trust
them on Gtk+ matters.

The only way I could see was to violate the GtkType abstraction and
cut and past GtkTypeNode so you can alter the type data, but this is
not an acceptable solution for production code.

 - Maciej





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