]> www.fi.muni.cz Git - evince.git/commitdiff
Cleanup the old job when changing document
authorMarco Pesenti Gritti <mpg@redhat.com>
Mon, 6 Jun 2005 09:01:06 +0000 (09:01 +0000)
committerMarco Pesenti Gritti <marco@src.gnome.org>
Mon, 6 Jun 2005 09:01:06 +0000 (09:01 +0000)
2005-06-06  Marco Pesenti Gritti <mpg@redhat.com>

        * shell/ev-sidebar-links.c: (job_finished_callback),
        (ev_sidebar_links_set_document):

        Cleanup the old job when changing document

ChangeLog
shell/ev-sidebar-links.c

index b2ac0f51028574c3a54ffd938e030ffadb217268..16b6dc9705a4c80d6b514754b637836b8741b650 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-06-06  Marco Pesenti Gritti <mpg@redhat.com>
+
+       * shell/ev-sidebar-links.c: (job_finished_callback),
+       (ev_sidebar_links_set_document):
+
+       Cleanup the old job when changing document
+
 2005-06-05  Nickolay V. Shmyrev  <<nshmyrev@yandex.ru>>
 
        * shell/ev-stock-icons.c:
index 1d73822b5567cb23b22e312d6c4af9455474e9a6..ac34bac4f2484edbf06a680f84a2e4e131899d03 100644 (file)
@@ -523,6 +523,7 @@ job_finished_callback (EvJobLinks     *job,
 
        gtk_tree_view_set_model (GTK_TREE_VIEW (priv->tree_view), job->model);
        g_object_unref (job);
+       priv->job = NULL;
 
        /* Expand one level of the tree */
        path = gtk_tree_path_new_first ();
@@ -572,6 +573,13 @@ ev_sidebar_links_set_document (EvSidebarPage  *sidebar_page,
        priv->document = g_object_ref (document);
        priv->page_cache = ev_document_get_page_cache (document);
 
+       if (priv->job) {
+               g_signal_handlers_disconnect_by_func (priv->job,
+                                                     job_finished_callback,
+                                                     sidebar_links);
+               g_object_unref (priv->job);
+       }
+
        priv->job = ev_job_links_new (document);
        g_signal_connect (priv->job,
                          "finished",
@@ -579,7 +587,6 @@ ev_sidebar_links_set_document (EvSidebarPage  *sidebar_page,
                          sidebar_links);
        /* The priority doesn't matter for this job */
        ev_job_queue_add_job (priv->job, EV_JOB_PRIORITY_LOW);
-
 }
 
 static gboolean