[balsa] balsa-index: Do not leak row-reference



commit c5f92fa925092aaab38c5351dbf996440849eee9
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Sun Jan 19 14:59:41 2020 -0500

    balsa-index: Do not leak row-reference
    
    If the BalsaIndex is destroyed before the idle handler has been called,
    free the GtkRowReference.

 src/balsa-index.c | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/src/balsa-index.c b/src/balsa-index.c
index 4a5a0039c..a92a268f2 100644
--- a/src/balsa-index.c
+++ b/src/balsa-index.c
@@ -270,6 +270,11 @@ bndx_destroy(GObject * obj)
     g_free(bindex->filter_string);
     bindex->filter_string = NULL;
 
+    if (bindex->reference != NULL) {
+        gtk_tree_row_reference_free(bindex->reference);
+        bindex->reference = NULL;
+    }
+
     G_OBJECT_CLASS(balsa_index_parent_class)->dispose(obj);
 }
 
@@ -1299,6 +1304,7 @@ bndx_expand_to_row_and_select_idle(BalsaIndex *bindex)
 
     path = gtk_tree_row_reference_get_path(bindex->reference);
     gtk_tree_row_reference_free(bindex->reference);
+    bindex->reference = NULL;
 
     bndx_select_row(bindex, path);
     gtk_tree_path_free(path);


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