diff options
author | Darin Adler <darin@src.gnome.org> | 2001-10-02 15:53:19 +0000 |
---|---|---|
committer | Darin Adler <darin@src.gnome.org> | 2001-10-02 15:53:19 +0000 |
commit | cc42f95ed13770a5088f45a381fcad140ab1dd6f (patch) | |
tree | de5765c98456ae9e270d1b3ef72db8d799750f85 /src/nautilus-window.c | |
parent | caab8b4256febf9a919c20ad571defbf20b77162 (diff) | |
download | nautilus-cc42f95ed13770a5088f45a381fcad140ab1dd6f.tar.gz |
Fix bug where we would leave a file monitored when we closed the window.
* src/nautilus-window.c: (nautilus_window_destroy),
(nautilus_window_set_viewed_file): Fix bug where we would leave a
file monitored when we closed the window.
* libnautilus-private/nautilus-volume-monitor.c:
(mount_unmount_callback): Formatting tweaks.
Diffstat (limited to 'src/nautilus-window.c')
-rw-r--r-- | src/nautilus-window.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/nautilus-window.c b/src/nautilus-window.c index e16fefcee..56dd7dd08 100644 --- a/src/nautilus-window.c +++ b/src/nautilus-window.c @@ -944,8 +944,7 @@ nautilus_window_destroy (GtkObject *object) nautilus_window_manage_views_destroy (window); /* Get rid of all callbacks. */ - - cancel_view_as_callback (window); + nautilus_window_set_viewed_file (window, NULL); nautilus_window_remove_bookmarks_menu_callback (window); nautilus_window_remove_go_menu_callback (window); nautilus_window_toolbar_remove_theme_callback (window); @@ -2274,19 +2273,22 @@ nautilus_window_set_viewed_file (NautilusWindow *window, return; } + nautilus_file_ref (file); + + cancel_view_as_callback (window); + cancel_chose_component_callback (window); + if (window->details->viewed_file != NULL) { nautilus_file_monitor_remove (window->details->viewed_file, window); } - nautilus_file_ref (file); - - attributes = g_list_prepend (NULL, NAUTILUS_FILE_ATTRIBUTE_CUSTOM_NAME); - nautilus_file_monitor_add (file, window, attributes); - g_list_free (attributes); + if (file != NULL) { + attributes = g_list_prepend (NULL, NAUTILUS_FILE_ATTRIBUTE_CUSTOM_NAME); + nautilus_file_monitor_add (file, window, attributes); + g_list_free (attributes); + } - cancel_view_as_callback (window); - cancel_chose_component_callback (window); nautilus_file_unref (window->details->viewed_file); window->details->viewed_file = file; } |