Skip to content

GLib-GObject-CRITICAL **: 20:12:57.178: g_object_ref: assertion 'old_val > 0' failed #41

@Lotharla

Description

@Lotharla

This is my source code:

`static void destroy(GtkWidget *widget, gpointer data)
{
gtk_main_quit();
}

int main(int argc, char *argv[])
{
gtk_init(&argc, &argv);

GtkWidget *window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_default_size(GTK_WINDOW(window), 200, 200);
g_signal_connect(window, "destroy", G_CALLBACK(destroy), NULL);

GtkWidget *window_box = gtk_box_new (GTK_ORIENTATION_VERTICAL,3);

GtkWidget *scrolled_window = gtk_scrolled_window_new(NULL, NULL);
gtk_container_add (GTK_CONTAINER (window), window_box);
gtk_box_pack_start (GTK_BOX (window_box), scrolled_window, 1,1,1);
GtkSheet *sheet = (GtkSheet *)gtk_sheet_new(3,11,"Edit table");
GTK_SHEET_AUTORESIZE(sheet);
gtk_container_add(GTK_CONTAINER(scrolled_window), (GtkWidget *)sheet);
gtk_sheet_show_grid(sheet, TRUE);
gtk_widget_show_all(window);

gtk_main();

return 0;

}
`
After installing gtksheet i did the following:
gcc -g -O0 $(pkg-config --cflags gtksheet-4.0) gtksheet.c $(pkg-config --libs gtksheet-4.0) && ./a.out

This happened when i closed the windowt:
(a.out:114519): GLib-GObject-CRITICAL **: 20:12:57.178: g_object_ref: assertion 'old_val > 0' failed
Segmentation fault (core dumped)

Same thing when i started the test:
cd ~/gtksheet-4.3.12/gtksheet ; ./testgtksheet

(testgtksheet:115066): GLib-GObject-CRITICAL **: 20:50:19.657: g_object_ref: assertion 'old_val > 0' failed
Segmentation fault (core dumped)

Why ... ?
What did i do wrong ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions