From 6a51edb6f6db86cb3f63519b0300b9c8c27ed63f Mon Sep 17 00:00:00 2001 From: Carlos Garcia Campos Date: Sun, 28 Jan 2007 22:34:29 +0000 Subject: [PATCH] Fix memory leak. 2007-01-29 Carlos Garcia Campos * shell/ev-window.c: (ev_window_add_history): Fix memory leak. svn path=/trunk/; revision=2270 --- ChangeLog | 6 ++++++ shell/ev-view.c | 1 - shell/ev-window.c | 9 ++++----- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 20cbebe9..fe5b0a57 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-01-29 Carlos Garcia Campos + + * shell/ev-window.c: (ev_window_add_history): + + Fix memory leak. + 2007-01-29 Nickolay V. Shmyrev * shell/ev-view.c: (ev_view_page_label_from_dest), (tip_from_link): diff --git a/shell/ev-view.c b/shell/ev-view.c index 072ca082..15053d47 100644 --- a/shell/ev-view.c +++ b/shell/ev-view.c @@ -1348,7 +1348,6 @@ ev_view_handle_link (EvView *view, EvLink *link) if (!action) return; - type = ev_link_action_get_action_type (action); switch (type) { diff --git a/shell/ev-window.c b/shell/ev-window.c index dc034091..341907b7 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -680,10 +680,9 @@ ev_window_find_chapter (GtkTreeModel *tree_model, static void ev_window_add_history (EvWindow *window, gint page, EvLink *link) { - const gchar *page_label = NULL; + gchar *page_label = NULL; gchar *link_title; FindTask find_task; - EvLink *real_link; EvLinkAction *action; EvLinkDest *dest; @@ -692,7 +691,7 @@ ev_window_add_history (EvWindow *window, gint page, EvLink *link) action = g_object_ref (ev_link_get_action (link)); dest = ev_link_action_get_dest (action); page = ev_link_dest_get_page (dest); - page_label = ev_view_page_label_from_dest (window->priv->view, dest); + page_label = ev_view_page_label_from_dest (EV_VIEW (window->priv->view), dest); } else { dest = ev_link_dest_new_page (page); action = ev_link_action_new_dest (dest); @@ -712,7 +711,6 @@ ev_window_add_history (EvWindow *window, gint page, EvLink *link) g_object_get (G_OBJECT (window->priv->sidebar_links), "model", &model, NULL); if (model) { - gtk_tree_model_foreach (model, ev_window_find_chapter, &find_task); @@ -729,7 +727,8 @@ ev_window_add_history (EvWindow *window, gint page, EvLink *link) real_link = ev_link_new (link_title, action); ev_history_add_link (window->priv->history, real_link); - + + g_free (find_task.chapter); g_free (link_title); g_free (page_label); g_object_unref (real_link); -- 2.43.5