From a65f0c33e09c4d84b9149d13fe48bbfe8d8adff0 Mon Sep 17 00:00:00 2001 From: Sergio Villar Senin Date: Wed, 11 Feb 2009 15:40:50 +0000 Subject: [PATCH] Do not update window title if the window is not visible. Fixes an invalid read pmo-trunk-r7462 --- src/hildon2/modest-msg-view-window.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/hildon2/modest-msg-view-window.c b/src/hildon2/modest-msg-view-window.c index 31a1044..28dc4f4 100644 --- a/src/hildon2/modest-msg-view-window.c +++ b/src/hildon2/modest-msg-view-window.c @@ -94,7 +94,7 @@ struct _ModestMsgViewWindowPrivate { /* Whether the message is in outbox */ gboolean is_outbox; - + /* A reference to the @model of the header view * to allow selecting previous/next messages, * if the message is currently selected in the header view. @@ -116,7 +116,7 @@ struct _ModestMsgViewWindowPrivate { GtkWidget *remove_attachment_banner; gchar *msg_uid; - + GSList *sighandlers; }; @@ -2965,11 +2965,15 @@ modest_msg_view_window_remove_attachments (ModestMsgViewWindow *window, gboolean static void update_window_title (ModestMsgViewWindow *window) { - ModestMsgViewWindowPrivate *priv = MODEST_MSG_VIEW_WINDOW_GET_PRIVATE (window); + ModestMsgViewWindowPrivate *priv; TnyMsg *msg = NULL; TnyHeader *header = NULL; gchar *subject = NULL; + if (!GTK_WIDGET_VISIBLE (window)) + return; + + priv = MODEST_MSG_VIEW_WINDOW_GET_PRIVATE (window); msg = tny_msg_view_get_msg (TNY_MSG_VIEW (priv->msg_view)); if (msg != NULL) { @@ -2988,9 +2992,10 @@ update_window_title (ModestMsgViewWindow *window) } -static void on_move_focus (GtkWidget *widget, - GtkDirectionType direction, - gpointer userdata) +static void +on_move_focus (GtkWidget *widget, + GtkDirectionType direction, + gpointer userdata) { g_signal_stop_emission_by_name (G_OBJECT (widget), "move-focus"); } -- 1.7.9.5