Re: how have I managed to break gtk_button_new_with_lable?!



rob <mailingLists pangolin org uk> writes:
Here's my bit of code

static void
AttrEditingFrame_init (AttrEditingFrame *self)
{
      GtkWidget *vbox;
      GtkWidget *newAttrButton;
       
      self->attrEntries = g_ptr_array_new();
      
      vbox = gtk_vbox_new(FALSE, 5);
      
      newAttrButton = gtk_button_new_with_label ("New Attribute");
      gtk_signal_connect (GTK_OBJECT (newAttrButton),
                                      "clicked",
                                      create_attr_cb,
                                      self);
      gtk_box_pack_start (GTK_BOX (vbox),
                          newAttrButton, 
                          TRUE, TRUE, 5);

      gtk_container_add (GTK_CONTAINER (self), vbox);
}

It segfaults every time when it gets to gtk_button_new_with_label

Under the terminal it says:
Gtk-CRITICAL **: file gtkstyle.c: line 611 (gtk_style_ref): assertion
`style->ref_count > 0' failed.

Under gdb it says:
Program received signal SIGSEGV, Segmentation fault.
0x4059934d in free () from /lib/libc.so.6

any one have any idea I'm completly stumped 


Probably the style is getting munged earlier in your program, and the
gtk_button_new_with_label() is the first time you try to use it
post-munge. Styles for widgets are recycled.

Maybe you have one too many gtk_style_unref() someplace, or something
along those lines.

MALLOC_CHECK_=2 can be a useful tool on Linux, see malloc() man page.

Havoc




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