]> www.fi.muni.cz Git - evince.git/commitdiff
Add some checks and call parent_class->finalize. Fixes bug #404745.
authorCarlos Garcia Campos <carlosgc@gnome.org>
Tue, 6 Feb 2007 10:05:30 +0000 (10:05 +0000)
committerCarlos Garcia Campos <carlosgc@src.gnome.org>
Tue, 6 Feb 2007 10:05:30 +0000 (10:05 +0000)
2007-02-06  Carlos Garcia Campos  <carlosgc@gnome.org>
* shell/ev-page-cache.c: (ev_page_cache_finalize):
Add some checks and call parent_class->finalize. Fixes bug #404745.

svn path=/trunk/; revision=2299

ChangeLog
shell/ev-page-cache.c

index 796bf030cd464e237c781d3920dfc9cfb7e50b55..d955ee8ff10e4687807f56d09cfbc9f16f5c2ffe 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-02-06  Carlos Garcia Campos  <carlosgc@gnome.org>
+
+       * shell/ev-page-cache.c: (ev_page_cache_finalize):
+
+       Add some checks and call parent_class->finalize. Fixes bug #404745.
+
 2007-02-06  Nickolay V. Shmyrev  <nshmyrev@yandex.ru>
 
        * shell/ev-navigation-action.c: (connect_proxy):
index 070df9d767a0972ca8d9fc3fcef8d8cf443186c1..0116452064eee2dcd2bc4ea12250385ecdb1f80c 100644 (file)
@@ -108,13 +108,37 @@ ev_page_cache_finalize (GObject *object)
 
        page_cache = EV_PAGE_CACHE (object);
 
-       g_free (page_cache->title);
-       g_free (page_cache->size_cache);
-       g_free (page_cache->height_to_page);
-       g_free (page_cache->dual_height_to_page);
-       g_strfreev (page_cache->page_labels);
+       if (page_cache->title) {
+               g_free (page_cache->title);
+               page_cache->title = NULL;
+       }
+
+       if (page_cache->size_cache) {
+               g_free (page_cache->size_cache);
+               page_cache->size_cache = NULL;
+       }
+
+       if (page_cache->height_to_page) {
+               g_free (page_cache->height_to_page);
+               page_cache->height_to_page = NULL;
+       }
+
+       if (page_cache->dual_height_to_page) {
+               g_free (page_cache->dual_height_to_page);
+               page_cache->dual_height_to_page = NULL;
+       }
+
+       if (page_cache->page_labels) {
+               g_strfreev (page_cache->page_labels);
+               page_cache->page_labels = NULL;
+       }
+
+       if (page_cache->page_info) {
+               ev_document_info_free (page_cache->page_info);
+               page_cache->page_info = NULL;
+       }
 
-       ev_document_info_free (page_cache->page_info);
+       G_OBJECT_CLASS (ev_page_cache_parent_class)->finalize (object);
 }
 
 static void