Hello
Can someone help me with a problem I’m having.
I don’t understand why the error.
I have a GtkListBoxRow with two GtkLabel.
I get the text from GtkLabel at GtkListBoxRow.
I pass the obtained text to another GtkLabel that is in a GtkBox.
The destroy the GtkListBoxRow the program closes with the error:
Segmentation fault (core dumped)
Note that you are not copying the label text, you are still passing around the reference owned by the label.
However this shouldn’t be the issue at hand: It’s true that gtk_label_get_text() keeps ownership of the string, but gtk_label_set_text() copies the passed string rather than taking ownership of it.
I recommend you run your program in gdb to get a backtrace instead of trying to guess the cause.
Thank you for the advice.
I check in my code that after deleting the GtkListBoxRow it was destroyed, the row-selected signal was emitted again and a null pointer was passed to the function. With this the error occurred.
I am implementing a financial control program in c, and use as a base the Gnome Contacts designer, I already implemented the side panel, the one with the names and a round label, and the error occurred when I selected an item in the GtkListBox and clicked the delete button. Now it works before trying to delete I check if the point is null, I don’t know if this is the correct way but it worked.