]> www.fi.muni.cz Git - evince.git/commitdiff
Solve more refs issues.
authorMarco Pesenti Gritti <marco@gnome.org>
Mon, 7 Feb 2005 22:09:43 +0000 (22:09 +0000)
committerMarco Pesenti Gritti <marco@src.gnome.org>
Mon, 7 Feb 2005 22:09:43 +0000 (22:09 +0000)
2005-02-07  Marco Pesenti Gritti  <marco@gnome.org>

        * shell/ev-page-view.c: (ev_page_view_dispose):
        * shell/ev-view.c: (ev_view_finalize):
        * shell/ev-window.c: (ev_window_setup_document),
        (ev_window_dispose), (ev_window_init):

        Solve more refs issues.

        I commented out the page_view initialization for now:
        it was never destroyed (because it's never added
        to a container). Because of that we was leaking
        gs processes. Couldnt think to a clean fix.
        We need to figure this out, password view has the
        same issue probably.

ChangeLog
shell/ev-page-view.c
shell/ev-view.c
shell/ev-window.c

index ab79810869f3ab3b2d837683d6ec8a5a7d8099de..57a9a97851801d41f3e97bf52a8c2134d65ae00e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2005-02-07  Marco Pesenti Gritti  <marco@gnome.org>
+
+       * shell/ev-page-view.c: (ev_page_view_dispose):
+       * shell/ev-view.c: (ev_view_finalize):
+       * shell/ev-window.c: (ev_window_setup_document),
+       (ev_window_dispose), (ev_window_init):
+
+       Solve more refs issues.
+
+       I commented out the page_view initialization for now:
+       it was never destroyed (because it's never added
+       to a container). Because of that we was leaking
+       gs processes. Couldnt think to a clean fix.
+       We need to figure this out, password view has the
+       same issue probably.
+
 2005-02-07  Marco Pesenti Gritti  <marco@gnome.org>
 
        * ps/ps-document.c: (ps_document_finalize),
index 4b019c4b651ab027a3dfdf18b547c2a872c3997a..17359521286804fa87c6e2cd808414e45f92f795 100644 (file)
@@ -21,6 +21,7 @@
 #include "ev-page-view.h"
 #include "ev-marshal.h"
 #include "ev-document-misc.h"
+#include "ev-debug.h"
 #include <gtk/gtk.h>
 
 /* We keep a cached array of all the page sizes.  The info is accessed via
@@ -102,6 +103,8 @@ ev_page_view_dispose (GObject *object)
 {
        EvPageView *view = EV_PAGE_VIEW (object);
 
+       LOG ("dispose")
+
        if (view->priv->document) {
                g_object_unref (view->priv->document);
                view->priv->document = NULL;
index d4fa6a279f565548d6f606c4ae9f8dcf62c09899..51c7bb2085fdee38221b32ebb68f3d18d336d241 100644 (file)
@@ -183,6 +183,8 @@ ev_view_finalize (GObject *object)
 {
        EvView *view = EV_VIEW (object);
 
+       LOG ("Finalize")
+
        if (view->document)
                g_object_unref (view->document);
 
index 875e271dd97e07cbf646ada5920607ad65cfc9fe..84206b7a4c99742e01bfb0d4a3f2efbdfb58d39d 100644 (file)
@@ -390,7 +390,7 @@ ev_window_setup_document (EvWindow *ev_window)
 {
        EvDocument *document;
        EvView *view = EV_VIEW (ev_window->priv->view);
-       EvPageView *page_view = EV_PAGE_VIEW (ev_window->priv->page_view);
+       //EvPageView *page_view = EV_PAGE_VIEW (ev_window->priv->page_view);
        EvSidebar *sidebar = EV_SIDEBAR (ev_window->priv->sidebar);
 
        document = ev_window->priv->document;
@@ -404,7 +404,7 @@ ev_window_setup_document (EvWindow *ev_window)
 
        ev_sidebar_set_document (sidebar, document);
        ev_view_set_document (view, document);
-       ev_page_view_set_document (page_view, document);
+       //ev_page_view_set_document (page_view, document);
 
        update_window_title (document, NULL, ev_window);
        update_total_pages (ev_window);
@@ -1472,7 +1472,17 @@ ev_window_dispose (GObject *object)
                g_object_unref (priv->document);
                priv->document = NULL;
        }
-       
+
+       if (priv->view) {
+               g_object_unref (priv->view);
+               priv->view = NULL;
+       }
+
+       if (priv->page_view) {
+               g_object_unref (priv->page_view);
+               priv->page_view = NULL;
+       }
+
        if (priv->password_document) {
                g_object_unref (priv->password_document);
                priv->password_document = NULL;
@@ -1843,19 +1853,19 @@ ev_window_init (EvWindow *ev_window)
                        ev_window->priv->scrolled_window);
 
        ev_window->priv->view = ev_view_new ();
-       ev_window->priv->page_view = ev_page_view_new ();
+       //ev_window->priv->page_view = ev_page_view_new ();
        ev_window->priv->password_view = ev_password_view_new ();
        g_signal_connect_swapped (ev_window->priv->password_view,
                                  "unlock",
                                  G_CALLBACK (ev_window_popup_password_dialog),
                                  ev_window);
        gtk_widget_show (ev_window->priv->view);
-       gtk_widget_show (ev_window->priv->page_view);
+       //gtk_widget_show (ev_window->priv->page_view);
        gtk_widget_show (ev_window->priv->password_view);
 
        /* We own a ref on these widgets, as we can swap them in and out */
        g_object_ref (ev_window->priv->view);
-       g_object_ref (ev_window->priv->page_view);
+       //g_object_ref (ev_window->priv->page_view);
        g_object_ref (ev_window->priv->password_view);
 
        gtk_container_add (GTK_CONTAINER (ev_window->priv->scrolled_window),