[gtk/matthiasc/for-master] editablelabel: Properly clean up in dispose



commit cb8bf6540ce5541aa236b7ab2f4158cf55d7fae9
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Oct 23 12:27:55 2020 -0400

    editablelabel: Properly clean up in dispose
    
    Unparenting the stack finalizes the entry and label,
    but at least the label is available via the
    gtk_editable_get_delegate API, and the a11y
    implementation uses that at dispose time. So, clear
    the pointers to prevent them from being dangling.
    
    This was showing up as a segfault of the doc-shooter.

 gtk/gtkeditablelabel.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/gtk/gtkeditablelabel.c b/gtk/gtkeditablelabel.c
index 959d0428d8..103b125649 100644
--- a/gtk/gtkeditablelabel.c
+++ b/gtk/gtkeditablelabel.c
@@ -341,6 +341,9 @@ gtk_editable_label_dispose (GObject *object)
 
   g_clear_pointer (&self->stack, gtk_widget_unparent);
 
+  self->entry = NULL;
+  self->label = NULL;
+
   G_OBJECT_CLASS (gtk_editable_label_parent_class)->dispose (object);
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]