* src/modest-ui-actions.c:
authorJose Dapena Paz <jdapena@igalia.com>
Thu, 10 May 2007 07:29:12 +0000 (07:29 +0000)
committerJose Dapena Paz <jdapena@igalia.com>
Thu, 10 May 2007 07:29:12 +0000 (07:29 +0000)
* Fixed minor memory leak in password dialog sizegroup.
* src/maemo/modest-msg-edit-window.c:
* Now font selection dialog has parent window set to the
editor window.
* I was doing gdk_color_free of a color that's internally
  referenced by the font selection dialog. This caused a
  double free that lead to a crash on finishing the font
  selection dialog. I removed it (fixes NB#56477).
* src/widgets/modest-folder-view.c:
* Now the cell_data_func unreferences the pixbuf after
  adding it to the cell renderer, as it's getting its own
  reference. This removes a leak of all the pixbufs in
  the folder view.

pmo-trunk-r1817

src/maemo/modest-msg-edit-window.c
src/modest-ui-actions.c
src/widgets/modest-folder-view.c

index 29f088a..d7eca1c 100644 (file)
@@ -1869,7 +1869,7 @@ modest_msg_edit_window_select_font (ModestMsgEditWindow *window)
        g_return_if_fail (MODEST_IS_MSG_EDIT_WINDOW (window));
        priv = MODEST_MSG_EDIT_WINDOW_GET_PRIVATE (window);
        
-       dialog = hildon_font_selection_dialog_new (NULL, NULL);
+       dialog = hildon_font_selection_dialog_new (GTK_WINDOW (window), NULL);
 
        /* First we get the currently selected font information */
        wp_text_buffer_get_attributes (WP_TEXT_BUFFER (priv->text_buffer), &oldfmt, TRUE);
@@ -1931,8 +1931,6 @@ modest_msg_edit_window_select_font (ModestMsgEditWindow *window)
                
        }       
 
-       gtk_widget_destroy (dialog);
-       
        if (response == GTK_RESPONSE_OK) {
                memset(&fmt, 0, sizeof(fmt));
                if (bold_set) {
@@ -1964,7 +1962,6 @@ modest_msg_edit_window_select_font (ModestMsgEditWindow *window)
                        fmt.color = *color;
                        fmt.cs.color = TRUE;
                }
-               gdk_color_free(color);
                if (font_set) {
                        fmt.font = wp_get_font_index(font_name,
                                                     DEFAULT_FONT);
@@ -1976,6 +1973,8 @@ modest_msg_edit_window_select_font (ModestMsgEditWindow *window)
                                font_size, DEFAULT_FONT_SIZE);
                        fmt.cs.font_size = TRUE;
                }
+               gtk_widget_destroy (dialog);
+       
                gtk_widget_grab_focus(GTK_WIDGET(priv->msg_body));
                wp_text_buffer_set_format(WP_TEXT_BUFFER(priv->text_buffer), &fmt);
        }
index fd09f13..361ba20 100644 (file)
@@ -1672,6 +1672,7 @@ modest_ui_actions_on_password_requested (TnyAccountStore *account_store,
        gtk_box_pack_start (GTK_BOX(GTK_DIALOG(dialog)->vbox), caption, 
                FALSE, FALSE, MODEST_MARGIN_HALF);
        gtk_widget_show (caption);
+       g_object_unref (sizegroup);
 #else 
        gtk_box_pack_start (GTK_BOX(GTK_DIALOG(dialog)->vbox), entry_password,
                            TRUE, FALSE, 0);
index ff7fc28..ec6f5c5 100644 (file)
@@ -403,6 +403,9 @@ icon_cell_data  (GtkTreeViewColumn *column,  GtkCellRenderer *renderer,
 
        /* Set pixbuf */
        g_object_set (rendobj, "pixbuf", pixbuf, NULL);
+
+       if (pixbuf != NULL)
+               g_object_unref (pixbuf);
 }
 
 static void