#55908 Need a function to know if a GBoxed type is reference counte [?]



> > 55908  Need a function to know if a GBoxed type is reference counte [?] 
> >   Notes:    Consensus was that if you cared for a particular GBoxed type, then
> >             the GBoxed should be a GObject. Some open question about whether 
> >             the is-refcounted parameter to g_boxed_register_static was
> >             necessary.
> >   Puntable: Yes. Worst that happens it that g_boxed_register_static()
> >             is a little more confusing
> >   Breakage: Yes, small amount of fixage.
> >   Time:     0.5 hours
> 
> the point in is_refcounted here is really to work around users erroneously
> specifying G_SIGNAL_TYPE_STATIC_SCOPE for ref counted boxed types.
> G_SIGNAL_TYPE_STATIC_SCOPE only makes sense for value-copied boxed types,
> for refcounted boxed types it just defeats object consistency prevention
> during signal emission. i basically see two ways of handling this:
> 1) get rid of gboolean is_refcounted in g_boxed_type_register_static() and
>    hope all the best for signal creators to not screw the system
> 2) leave it as it is, but actually use the flag to puke on the user
>    if he abuses G_SIGNAL_TYPE_STATIC_SCOPE as described above (currently
>    we're silent which doesn't make too much sense)

I don't think trying to second-guess the user makes a lot of sense. 

If we think it's OK to have a G_SIGNAL_TYPE_STATIC_SCOPE flag, then we
should make sure it acts as simply and consistently as possible. Not
spend effort trying to guess when the programmer didn't _really_ want
G_SIGNAL_TYPE_STATIC_SCOPE.

If we could magically make things a bit safer while keeping everything
just as simple, then sure it might make sense, but this way:

 - We've introduced something else that everybody who creates a boxed
   types needs to understand and remember.

   (And yes, creating boxed types will be fairly common. For instance,
   it often makes sense to use a new boxed type as the data in a 1-column
   GtkListStore.)

 - We've introduced a new possible bug (specifying is_refcounted=TRUE when
   you shouldn't have.)

> this issue is not puntable however, since deciding to get rid of
> gboolean is_refcounted affects public API and would impose huge breakage
> in 2.2.

Yeah, I misued the "Puntable:" field here a bit. I just meant that if
we didn't make the change, no functionality would be lost.

Regards,
                                        Owen




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