Re: ActivationContext and shlib servers



Michael Meeks <michael ximian com> writes:

> 
> 	Well; fair enough, however assuming we arn't using the base class
> initialization ( which few people use ), then I think we can dispense with
> the delayed class_init function altogether - I propose:
>

Don't know enough about the gtk type system to say if this would work
- at first glance it seems to me like you'd still end up with a messed
up GtkTypeNode struct.

It also seems like it wouldn't actually do the right thing for
subclasses - it would overwrite virtual functions overriden by
children with the new parent calls.

I'd love to hear Owen and Havoc's comments on this approach though.

 
> GtkType
> bonobo_type_unique (...)
> {
> 	GtkType old, new;
> 
> 	assert (info->instance_init == NULL);
> 
> 	if ((old = gtk_type_from_name (info->name)) {
> 		Klass *new_class = g_malloc (info->class_size);
> 
> 		info->init_class (new_class);
> 		
> 		For-old-and-all-children-recursively {
> 			Klass = gtk_type_class (child_type);
> 			memcpy (klass, new_class, info->class_size);
> 		}
> 
> 		return old;
> 	} else {
> 		Tmpptr init_class = info->init_class;
> 		Klass *new_class;
> 
> 		info->init_class = NULL;
> 		new = gtk_type_unique (parent, info);
> 
> 		new_class = gtk_type_class (new);
> 		init_class (new_class);
> 		return new;		
> 	}
> }
> 
> 	That gets rid of the need for the class_init function to be set,
> and deals with the problem of stale children at the same time.
> 
> > > 	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.
> 
> 	Oh; well then, there is probably something silly in my above
> proposal, but I can't see it right now. Clearly there is the problem of
> people creating / using types with the same name from other places when
> the shlib has been unloaded, but that sounds like broken code anyway.
> 
> 	Regards,
> 
> 		Michael.
> 
> -- 
>  mmeeks gnu org  <><, Pseudo Engineer, itinerant idiot




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