]> www.fi.muni.cz Git - evince.git/commitdiff
Remove the idle function for setting the document up when the window is
authorCarlos Garcia Campos <carlosgc@gnome.org>
Sun, 24 Aug 2008 14:23:23 +0000 (14:23 +0000)
committerCarlos Garcia Campos <carlosgc@src.gnome.org>
Sun, 24 Aug 2008 14:23:23 +0000 (14:23 +0000)
2008-08-24  Carlos Garcia Campos  <carlosgc@gnome.org>

* shell/ev-window.c: (ev_window_setup_document),
(ev_window_set_document), (ev_window_dispose):

Remove the idle function for setting the document up when the
window is destroyed. Fixes bug #549163.

svn path=/trunk/; revision=3117

ChangeLog
shell/ev-window.c

index 12b07fe1758b8e8752a7a5288cfde161ae9d20d3..d5d63022093a65a30d578b025c92eb6ade6adb8f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-08-24  Carlos Garcia Campos  <carlosgc@gnome.org>
+
+       * shell/ev-window.c: (ev_window_setup_document),
+       (ev_window_set_document), (ev_window_dispose):
+
+       Remove the idle function for setting the document up when the
+       window is destroyed. Fixes bug #549163.
+       
 2008-08-22  Carlos Garcia Campos  <carlosgc@gnome.org>
 
        * shell/ev-jobs.[ch]: (ev_job_attachments_init),
index 02932295e6cc2e2f250f01dfdf844ff708e16561..7b5a7705990256abd88841cc3ffed7da3e139e54 100644 (file)
@@ -166,6 +166,7 @@ struct _EvWindowPrivate {
        gboolean unlink_temp_file;
        gboolean in_reload;
        EvFileMonitor *monitor;
+       guint setup_document_idle;
        
        EvDocument *document;
        EvHistory *history;
@@ -1138,6 +1139,8 @@ ev_window_setup_document (EvWindow *ev_window)
        EvDocument *document = ev_window->priv->document;
        EvSidebar *sidebar = EV_SIDEBAR (ev_window->priv->sidebar);
        GtkAction *action;
+
+       ev_window->priv->setup_document_idle = 0;
        
        if (EV_IS_DOCUMENT_FIND (document)) {
                g_signal_connect_object (G_OBJECT (document),
@@ -1203,7 +1206,9 @@ ev_window_set_document (EvWindow *ev_window, EvDocument *document)
                                           _("The document contains no pages"));
        }
 
-       g_idle_add ((GSourceFunc)ev_window_setup_document, ev_window);
+       if (ev_window->priv->setup_document_idle > 0)
+               g_source_remove (ev_window->priv->setup_document_idle);
+       ev_window->priv->setup_document_idle = g_idle_add ((GSourceFunc)ev_window_setup_document, ev_window);
 }
 
 static void
@@ -4168,6 +4173,11 @@ ev_window_dispose (GObject *object)
        }
 #endif /* ENABLE_DBUS */
 
+       if (priv->setup_document_idle > 0) {
+               g_source_remove (priv->setup_document_idle);
+               priv->setup_document_idle = 0;
+       }
+       
        if (priv->monitor) {
                g_object_unref (priv->monitor);
                priv->monitor = NULL;