Re: GTK+ 1.2.10 style bug



"Joe.C" <joe animeta com> writes:

> Hi,
> 
>   I don't know if you are going to release 1.2.11,
> but I think I'll report this bug anyway.
> 
>   If we create a widget and change its style's
> bg_pixmap and show it, after we remove the widget
> from the container and add to another container, it
> will crash. I've attached a small test program to
> show the problem.
> 
>   The problem is from 1.2.9, gtk_style_detach will
> unreference the bg_pixmap. But when we re-attached
> the style, the pixmap will be used again.
> 
>   We can fix the problem by only unreference the
> bg_pixmap when we destroy the style, or set the
> bg_pixmap to NULL after we unreference it. I think
> unreference when the style is destroyed is a better
> idea. What's your opinion? I can create a patch if
> you think it is OK.

There are various problems in that area of code ... I have the
following patch in the current gtk+-1.2.10 SRPM, but it seems
that you are reporting something beyond this. If you could
file your bug in bugzilla.gnome.org I'd appreciate.

I do plan to work on a 1.2.11 sometime soonish, but I'm not 
sure when I'll find the time. There are ~10 reasonably important
fixes either in CVS or in the Red Hat RPM.

Having all the relevant issues in bugzilla will make sure
we don't forget them.

Regards,
                                        Owen

--- gtk+-1.2.10/gtk/gtkstyle.c.pixmapref	Tue Feb 20 11:46:58 2001
+++ gtk+-1.2.10/gtk/gtkstyle.c	Sun Aug 12 15:42:06 2001
@@ -348,8 +348,9 @@
       new_style->bg[i] = style->bg[i];
       new_style->text[i] = style->text[i];
       new_style->base[i] = style->base[i];
-      
-      new_style->bg_pixmap[i] = style->bg_pixmap[i];
+
+      if (style->bg_pixmap[i] && !(style->rc_style && style->rc_style->bg_pixmap_name[i]))
+	new_style->bg_pixmap[i] = gdk_pixmap_ref (style->bg_pixmap[i]);
     }
   
   gdk_font_unref (new_style->font);






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