GNOME Bugzilla – Bug 70601
Allow use of child anchor before inserting it into a buffer
Last modified: 2014-03-23 21:44:01 UTC
Test case: _________________ #include <gtk/gtk.h> int main (int argc, char** argv) { GtkTextChildAnchor* anchor; GList* list; gtk_init (&argc, &argv); anchor = gtk_text_child_anchor_new (); if (!anchor) { printf ("\nanchor is NULL\n"); return; } list = gtk_text_child_anchor_get_widgets (anchor); if (list) printf ("\nlist = %p\n", list); } ________ Output: Segmentation fault
What is going on is that it's not possible to use a child anchor until it is attached with gtk_text_buffer_insert_child_anchor(). This particular case has a meaningful fallback; probably in other cases nothing more is possible than a g_return_if_fail()?
2002-02-06 Havoc Pennington <hp@redhat.com> * gtk/gtktextchild.c: Add warnings if you try to use a child anchor that isn't inside a buffer. Really kind of lame; we should separate the anchor from the buffer. But not worth fixing for now. #70601
closing out ancient bugs