Unreference GtkTreeModel pointers after they've been added to a tree view.
authorAndrej Kacian <ticho@claws-mail.org>
Sat, 24 Feb 2018 21:30:51 +0000 (22:30 +0100)
committerAndrej Kacian <ticho@claws-mail.org>
Sat, 24 Feb 2018 21:30:51 +0000 (22:30 +0100)
This was forgotten in only a few cases.

src/addressadd.c
src/addrgather.c
src/editldap_basedn.c
src/gtk/foldersort.c
src/importldif.c
src/mimeview.c
src/plugins/pdf_viewer/poppler_viewer.c
src/plugins/pgpcore/select-keys.c
src/prefs_filtering.c

index b4874d8..44e28ca 100644 (file)
@@ -272,6 +272,7 @@ static void addressadd_create( void ) {
                        GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_POINTER);
 
        tree_folder = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store));
+       g_object_unref(store);
        gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(tree_folder), TRUE);
        gtk_tree_view_set_enable_tree_lines(GTK_TREE_VIEW(tree_folder), FALSE);
        gtk_tree_view_set_search_column(GTK_TREE_VIEW(tree_folder),
index 2fded27..92da1a6 100644 (file)
@@ -481,6 +481,7 @@ static void addrgather_page_finish( gint pageNum, gchar *pageLbl ) {
                        G_TYPE_STRING, G_TYPE_STRING, -1));
 
        viewCount = gtk_tree_view_new_with_model(GTK_TREE_MODEL(model));
+       g_object_unref(model);
        gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(viewCount), TRUE);
        gtk_tree_view_set_reorderable(GTK_TREE_VIEW(viewCount), FALSE);
        sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(viewCount));
index 70df32b..07a8fc5 100644 (file)
@@ -216,6 +216,7 @@ static void edit_ldap_bdn_create(void) {
        store = gtk_list_store_new(1, G_TYPE_STRING, -1);
 
        basedn_list = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store));
+       g_object_unref(store);
        gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(basedn_list), TRUE);
        sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(basedn_list));
        gtk_tree_selection_set_mode(sel, GTK_SELECTION_BROWSE);
index 79f85a8..8160235 100644 (file)
@@ -295,6 +295,7 @@ void foldersort_open()
 
        /* Create the view widget */
        folderlist = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store));
+       g_object_unref(store);
        gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(folderlist), TRUE);
        gtk_tree_view_set_reorderable(GTK_TREE_VIEW(folderlist), TRUE);
        selector = gtk_tree_view_get_selection(GTK_TREE_VIEW(folderlist));
index e10c344..379ea7c 100644 (file)
@@ -700,6 +700,7 @@ static void imp_ldif_page_fields( gint pageNum, gchar *pageLbl ) {
                        -1);
 
        view_fields = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store));
+       g_object_unref(store);
        gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(view_fields), TRUE);
        gtk_tree_view_set_reorderable(GTK_TREE_VIEW(view_fields), FALSE);
        sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(view_fields));
index dbb6259..223af09 100644 (file)
@@ -286,6 +286,7 @@ MimeView *mimeview_create(MainWindow *mainwin)
                                   G_TYPE_POINTER);
 
        ctree = gtk_tree_view_new_with_model(GTK_TREE_MODEL(model));
+       g_object_unref(model);
        gtk_tree_view_set_enable_search(GTK_TREE_VIEW(ctree), FALSE);
        gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(ctree),
                                        prefs_common.use_stripes_everywhere);
index effd911..8949098 100644 (file)
@@ -1822,6 +1822,8 @@ static MimeViewer *pdf_viewer_create(void)
                                        G_TYPE_DOUBLE);
 
        viewer->index_list = gtk_tree_view_new_with_model(GTK_TREE_MODEL(tree_store));
+       g_object_unref(tree_store);
+
        renderer = gtk_cell_renderer_text_new();
        column = gtk_tree_view_column_new_with_attributes(_("Name"),  renderer, "text", 0,  NULL);
        gtk_tree_view_append_column(GTK_TREE_VIEW(viewer->index_list), column);         
index 407d7c2..f558f6b 100644 (file)
@@ -454,6 +454,7 @@ create_dialog (struct select_keys_s *sk)
                                -1);
 
                view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store));
+               g_object_unref(store);
                gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(view), TRUE);
                gtk_tree_view_set_reorderable(GTK_TREE_VIEW(view), FALSE);
                sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(view));
index 799b54e..d18aed1 100644 (file)
@@ -1798,9 +1798,11 @@ static GtkWidget *prefs_filtering_list_view_create(void)
 {
        GtkTreeView *list_view;
        GtkTreeSelection *selector;
+       GtkListStore *store = prefs_filtering_create_data_store();
 
-       list_view = GTK_TREE_VIEW(gtk_tree_view_new_with_model(GTK_TREE_MODEL
-               (prefs_filtering_create_data_store())));
+       list_view = GTK_TREE_VIEW(gtk_tree_view_new_with_model(
+                               GTK_TREE_MODEL(store)));
+       g_object_unref(store);
 #ifdef GENERIC_UMPC
        g_object_set(list_view, "allow-checkbox-mode", FALSE, NULL);
 #endif