From: Carlos Garcia Campos Date: Tue, 6 Feb 2007 10:05:30 +0000 (+0000) Subject: Add some checks and call parent_class->finalize. Fixes bug #404745. X-Git-Tag: EVINCE_0_7_2~22 X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=31fb044ff1dd30863ae70bcd320319f000f52f9e;p=evince.git Add some checks and call parent_class->finalize. Fixes bug #404745. 2007-02-06 Carlos Garcia Campos * 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 --- diff --git a/ChangeLog b/ChangeLog index 796bf030..d955ee8f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-02-06 Carlos Garcia Campos + + * 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 * shell/ev-navigation-action.c: (connect_proxy): diff --git a/shell/ev-page-cache.c b/shell/ev-page-cache.c index 070df9d7..01164520 100644 --- a/shell/ev-page-cache.c +++ b/shell/ev-page-cache.c @@ -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