From: Marco Pesenti Gritti Date: Mon, 7 Feb 2005 22:09:43 +0000 (+0000) Subject: Solve more refs issues. X-Git-Tag: EVINCE_0_1_4~10 X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=29c8dda6046a5038a4d894ca2581199f217cf750;p=evince.git Solve more refs issues. 2005-02-07 Marco Pesenti Gritti * 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. --- diff --git a/ChangeLog b/ChangeLog index ab798108..57a9a978 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2005-02-07 Marco Pesenti Gritti + + * 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 * ps/ps-document.c: (ps_document_finalize), diff --git a/shell/ev-page-view.c b/shell/ev-page-view.c index 4b019c4b..17359521 100644 --- a/shell/ev-page-view.c +++ b/shell/ev-page-view.c @@ -21,6 +21,7 @@ #include "ev-page-view.h" #include "ev-marshal.h" #include "ev-document-misc.h" +#include "ev-debug.h" #include /* 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; diff --git a/shell/ev-view.c b/shell/ev-view.c index d4fa6a27..51c7bb20 100644 --- a/shell/ev-view.c +++ b/shell/ev-view.c @@ -183,6 +183,8 @@ ev_view_finalize (GObject *object) { EvView *view = EV_VIEW (object); + LOG ("Finalize") + if (view->document) g_object_unref (view->document); diff --git a/shell/ev-window.c b/shell/ev-window.c index 875e271d..84206b7a 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -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),