]> www.fi.muni.cz Git - evince.git/commitdiff
Various small fixes, mostly memory leaks. Thanks to valgrind.
authorNickolay V. Shmyrev <nshmyrev@src.gnome.org>
Sun, 19 Jun 2005 01:33:07 +0000 (01:33 +0000)
committerNickolay V. Shmyrev <nshmyrev@src.gnome.org>
Sun, 19 Jun 2005 01:33:07 +0000 (01:33 +0000)
* lib/ev-file-helpers.c: (ev_file_helpers_shutdown):
* shell/ev-sidebar-links.c: (create_loading_model):
* shell/ev-sidebar-thumbnails.c: (ev_sidebar_thumbnails_dispose):
* shell/ev-view.c: (ev_view_set_document):
* shell/ev-window.c: (ev_window_dispose):

Various small fixes, mostly memory leaks. Thanks to valgrind.

ChangeLog
lib/ev-file-helpers.c
shell/ev-sidebar-links.c
shell/ev-sidebar-thumbnails.c
shell/ev-view.c
shell/ev-window.c

index 8a098c09f0fc598638e076308d114047035b35fa..64d0462a76ff18dc22d17b92ebe27980b87ba496 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2005-06-19  Nickolay V. Shmyrev  <nshmyrev@yandex.ru>
+
+       * lib/ev-file-helpers.c: (ev_file_helpers_shutdown):
+       * shell/ev-sidebar-links.c: (create_loading_model):
+       * shell/ev-sidebar-thumbnails.c: (ev_sidebar_thumbnails_dispose):
+       * shell/ev-view.c: (ev_view_set_document):
+       * shell/ev-window.c: (ev_window_dispose):
+       
+       Various small fixes, mostly memory leaks. Thanks to valgrind.
+
 2005-06-19  Martin Kretzschmar  <martink@gnome.org>
 
        * ps/ps-document.c: remove the locale.h include again ;-). And
index b093853565c5292fb798386ce82106e56e48d4c7..ae8aae549915ae9d1b97e6d53a0165b91346b795 100644 (file)
@@ -80,8 +80,9 @@ ev_file_helpers_init (void)
 
 void
 ev_file_helpers_shutdown (void)
-{              
-       rmdir (tmp_dir);
+{      
+       if (tmp_dir != NULL)    
+               rmdir (tmp_dir);
 
        g_free (tmp_dir);
        g_free (dot_dir);
index 14b4b00982935986c5527bd5067206563a660af3..6573f808ac06645ef443334bd372f6297ef3e6b4 100644 (file)
@@ -228,7 +228,7 @@ create_loading_model (void)
        /* Creates a fake model to indicate that we're loading */
        retval = (GtkTreeModel *)gtk_list_store_new (EV_DOCUMENT_LINKS_COLUMN_NUM_COLUMNS,
                                                     G_TYPE_STRING,
-                                                    G_TYPE_OBJECT,
+                                                    G_TYPE_POINTER,
                                                     G_TYPE_BOOLEAN);
 
        gtk_list_store_append (GTK_LIST_STORE (retval), &iter);
index 93f4150483b0859266ee5dc5e3196d3a9fb71464..c2c07c84f51a285d263b392effb394744168e90f 100644 (file)
@@ -101,9 +101,16 @@ ev_sidebar_thumbnails_dispose (GObject *object)
        EvSidebarThumbnails *sidebar_thumbnails = EV_SIDEBAR_THUMBNAILS (object);
        
        ev_sidebar_thumbnails_clear_model (sidebar_thumbnails);
-       g_object_unref (sidebar_thumbnails->priv->loading_icon);
-       g_object_unref (sidebar_thumbnails->priv->list_store);
-
+       if (sidebar_thumbnails->priv->loading_icon) {
+               g_object_unref (sidebar_thumbnails->priv->loading_icon);
+               sidebar_thumbnails->priv->loading_icon = NULL;
+       }
+       
+       if (sidebar_thumbnails->priv->list_store) {
+               g_object_unref (sidebar_thumbnails->priv->list_store);
+               sidebar_thumbnails->priv->list_store = NULL;
+       }
+       
        G_OBJECT_CLASS (ev_sidebar_thumbnails_parent_class)->dispose (object);
 }
 
index c366b04c4f18dce855d60558b15e55ba42ad31e8..5cc6f57d549ec305d375d6cffa1c23ca18196793 100644 (file)
@@ -1931,6 +1931,8 @@ ev_view_set_document (EvView     *view,
        g_return_if_fail (EV_IS_VIEW (view));
 
        if (document != view->document) {
+               clear_caches (view);
+
                if (view->document) {
                         g_signal_handlers_disconnect_by_func (view->document,
                                                               find_changed_cb,
@@ -1940,8 +1942,6 @@ ev_view_set_document (EvView     *view,
 
                 }
 
-               clear_caches (view);
-
                view->document = document;
                view->find_page = 0;
                view->find_result = 0;
index 10bdb9cd6e9cfcfe6bf2badab566acaf730ba8f7..509ac252dcb4e0518675269e25bcf6fedc47ec7a 100644 (file)
@@ -2409,6 +2409,11 @@ ev_window_dispose (GObject *object)
                priv->toolbar_file = NULL;
        }
 
+       if (priv->recent_model) {
+               g_object_unref (priv->recent_model);
+               priv->recent_model = NULL;
+       }
+
        if (priv->ui_manager) {
                g_object_unref (priv->ui_manager);
                priv->ui_manager = NULL;