Commit 8d1eba09 authored by John Sullivan's avatar John Sullivan

Ref and destroy file infos correctly.

parent edb4ab4e
2000-01-19 John Sullivan <sullivan@eazel.com>
* src/file-manager/fm-directory-view.c:
Added #include <libgnomevfs/gnome-vfs-file-info.h>
(fm_directory_view_populate), (display_pending_entries):
Bump refcount on file info before adding it to directory.
(fm_directory_view_load_uri): Destroy directory list
before setting it to NULL. With previous change, this
should prevent leaking GnomeVFSFileInfos and their
lists.
2000-01-19 Darin Adler <darin@eazel.com>
* libnautilus/nautilus-directory.c: (nautilus_directory_finalize):
......
......@@ -33,6 +33,7 @@
#include <libgnome/gnome-i18n.h>
#include <libgnomevfs/gnome-vfs-async-ops.h>
#include <libgnomevfs/gnome-vfs-directory-list.h>
#include <libgnomevfs/gnome-vfs-file-info.h>
#include <libgnomevfs/gnome-vfs-uri.h>
#include <libgnomevfs/gnome-vfs-utils.h>
#include <libnautilus/nautilus-gtk-macros.h>
......@@ -344,6 +345,7 @@ fm_directory_view_populate (FMDirectoryView *view)
info = gnome_vfs_directory_list_get
(view->details->directory_list, position);
gnome_vfs_file_info_ref (info);
fm_directory_view_add_entry (view, info);
position = gnome_vfs_directory_list_position_next
......@@ -366,6 +368,7 @@ display_pending_entries (FMDirectoryView *view)
info = gnome_vfs_directory_list_get (view->details->directory_list,
view->details->current_position);
gnome_vfs_file_info_ref (info);
fm_directory_view_add_entry (view, info);
view->details->current_position = gnome_vfs_directory_list_position_next
......@@ -692,7 +695,8 @@ fm_directory_view_load_uri (FMDirectoryView *view,
gnome_vfs_uri_unref (view->details->uri);
view->details->uri = gnome_vfs_uri_new (uri);
/* FIXME: Does this leak? Where are we supposed to destroy the old value? */
if (view->details->directory_list != NULL)
gnome_vfs_directory_list_destroy (view->details->directory_list);
view->details->directory_list = NULL;
view->details->current_position = GNOME_VFS_DIRECTORY_LIST_POSITION_NONE;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment