diff options
author | Matthias Clasen <maclas@gmx.de> | 2004-01-31 22:11:07 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2004-01-31 22:11:07 +0000 |
commit | 16a0782cea268a585d7f3b1d0f7536a8c514f8e2 (patch) | |
tree | 12e78835125c5f27c131befd726e8e7b657329e9 /gtk/gtktextchild.c | |
parent | 27d4a3764b8d61f53422a7d59cde37423c5066f4 (diff) | |
download | gtk+-16a0782cea268a585d7f3b1d0f7536a8c514f8e2.tar.gz |
Don't crash when finalizing an unused GtkTextChildAnchor. (#132260,
Sat Jan 31 23:13:43 2004 Matthias Clasen <maclas@gmx.de>
* gtk/gtktextchild.c (gtk_text_child_anchor_finalize): Don't
crash when finalizing an unused GtkTextChildAnchor. (#132260,
muppet)
Diffstat (limited to 'gtk/gtktextchild.c')
-rw-r--r-- | gtk/gtktextchild.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/gtk/gtktextchild.c b/gtk/gtktextchild.c index 0cc68f347f..a92944e3d5 100644 --- a/gtk/gtktextchild.c +++ b/gtk/gtktextchild.c @@ -377,24 +377,27 @@ gtk_text_child_anchor_finalize (GObject *obj) seg = anchor->segment; - if (seg->body.child.tree != NULL) + if (seg) { - g_warning ("Someone removed a reference to a GtkTextChildAnchor " - "they didn't own; the anchor is still in the text buffer " - "and the refcount is 0."); - return; - } + if (seg->body.child.tree != NULL) + { + g_warning ("Someone removed a reference to a GtkTextChildAnchor " + "they didn't own; the anchor is still in the text buffer " + "and the refcount is 0."); + return; + } - tmp_list = seg->body.child.widgets; - while (tmp_list) - { - g_object_unref (tmp_list->data); - tmp_list = g_slist_next (tmp_list); - } + tmp_list = seg->body.child.widgets; + while (tmp_list) + { + g_object_unref (tmp_list->data); + tmp_list = g_slist_next (tmp_list); + } - g_slist_free (seg->body.child.widgets); + g_slist_free (seg->body.child.widgets); - g_free (seg); + g_free (seg); + } anchor->segment = NULL; } |