Re: Bug: push_visual/push_colormap bug related to styles on certain machines.




Chi-Deok Hwang <cdhwang@sr.hei.co.kr> writes:

> Hi,
> With following patch, at least warning message disappeared.
> But I cannot be sure this is correct.
> 
> --- gtkstyle.c.orig	Wed Jun  2 10:20:53 1999
> +++ gtkstyle.c	Wed Jun  2 10:23:21 1999
> @@ -527,6 +527,11 @@
>      gtk_style_ref (new_style);
>    
>    new_style->attach_count++;
> +  if (style != new_style) 
> +    {
> +      gtk_style_unref (style);
> +      gtk_style_ref (new_style);
> +    }
>    
>    return new_style;
>  }

I'm pretty sure this is right. The refcount behavior of
gtk_style_attach() is a bit weird. The call is used like:

 widget->style = gtk_style_attach (widget->style, some_window);

So if it is returning a new style, it needs to drop the
refcount on the old style.

I've appplied the patch to CVS. (I would appreciate
it if people with access to multivisual machines would
test it out - I'm basically just going on code-reading
and faith here.)

Thanks!
                                        Owen



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