summaryrefslogtreecommitdiff
path: root/gtk/gtktextchild.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-09-16 22:58:58 -0400
committerMatthias Clasen <mclasen@redhat.com>2020-09-16 23:01:49 -0400
commit7082624fd72dd42bbb1b8908195ed8b29a7baac5 (patch)
treee0c86c6571b8be4cd89018966b51f89b39bb9571 /gtk/gtktextchild.c
parent25d30011a0cf8bf08d39f0c92d0e5b7446ce26e4 (diff)
downloadgtk+-7082624fd72dd42bbb1b8908195ed8b29a7baac5.tar.gz
textview: Properly delete anchored children
When we remove anchors with widgets from the text buffer, we used to call gtk_widget_destroy(), which indirectly called gtk_container_remove() which cleared the child properly. When gtk_widget_destroy() was removed, we replaced the calls with gtk_widget_unparent(), but that is not enough. Explicitly call gtk_text_view_remove() instead - we know the parent is a text view.
Diffstat (limited to 'gtk/gtktextchild.c')
-rw-r--r--gtk/gtktextchild.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gtk/gtktextchild.c b/gtk/gtktextchild.c
index f569a503bd..4d5e30e44f 100644
--- a/gtk/gtktextchild.c
+++ b/gtk/gtktextchild.c
@@ -236,8 +236,8 @@ child_segment_delete_func (GtkTextLineSegment *seg,
{
GtkWidget *child = tmp_list->data;
- gtk_widget_unparent (child);
-
+ gtk_text_view_remove (GTK_TEXT_VIEW (gtk_widget_get_parent (child)), child);
+
tmp_list = tmp_list->next;
}