+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
void
ev_file_helpers_shutdown (void)
-{
- rmdir (tmp_dir);
+{
+ if (tmp_dir != NULL)
+ rmdir (tmp_dir);
g_free (tmp_dir);
g_free (dot_dir);
/* 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);
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);
}
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,
}
- clear_caches (view);
-
view->document = document;
view->find_page = 0;
view->find_result = 0;
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;