Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Lotharla opened this issue Aug 5, 2022 · 1 comment

Comments

@Lotharla
Copy link

Lotharla commented Aug 5, 2022

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 ?

@Lotharla
Copy link
Author

Lotharla commented Aug 6, 2022

more info concerning the issue:
||/ Name Version Architecture Description
+++-================-==================-============-====================================
ii libgtk-3-0:amd64 3.24.20-0ubuntu1.1 amd64 GTK graphical user interface library

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant