reviewed by: John Sullivan <sullivan@eazel.com>

Fixed bug 5435 (Irreproducible crash in nautilus_directory_destroy
	after copy/move operations).

	* libnautilus-extensions/nautilus-directory.c:
	(nautilus_directory_notify_files_moved): Removed an extra unref
	and slightly reordered the code to make it clearer why the rest of
	the ref count manipulation is correct.
This commit is contained in:
Darin Adler 2001-01-05 00:09:31 +00:00
parent f649b991af
commit c2ccb702b3
3 changed files with 24 additions and 6 deletions

View file

@ -1,3 +1,15 @@
2001-01-04 Darin Adler <darin@eazel.com>
reviewed by: John Sullivan <sullivan@eazel.com>
Fixed bug 5435 (Irreproducible crash in nautilus_directory_destroy
after copy/move operations).
* libnautilus-extensions/nautilus-directory.c:
(nautilus_directory_notify_files_moved): Removed an extra unref
and slightly reordered the code to make it clearer why the rest of
the ref count manipulation is correct.
2001-01-04 Darin Adler <darin@eazel.com>
reviewed by: Rebecca Schulman <rebecka@eazel.com>

View file

@ -1173,6 +1173,12 @@ nautilus_directory_notify_files_moved (GList *uri_pairs)
/* Locate the new directory. */
new_directory = get_parent_directory (pair->to_uri);
collect_parent_directories (parent_directories, new_directory);
/* We can unref now -- new_directory is in the
* parent directories list so it will be
* around until the end of this function
* anyway.
*/
nautilus_directory_unref (new_directory);
/* Update the file's name. */
name = nautilus_uri_get_basename (pair->to_uri);
@ -1189,9 +1195,6 @@ nautilus_directory_notify_files_moved (GList *uri_pairs)
(added_lists, new_directory, file);
}
nautilus_directory_unref (old_directory);
nautilus_directory_unref (new_directory);
/* Unref each file once to balance out nautilus_file_get. */
unref_list = g_list_prepend (unref_list, file);
}

View file

@ -1173,6 +1173,12 @@ nautilus_directory_notify_files_moved (GList *uri_pairs)
/* Locate the new directory. */
new_directory = get_parent_directory (pair->to_uri);
collect_parent_directories (parent_directories, new_directory);
/* We can unref now -- new_directory is in the
* parent directories list so it will be
* around until the end of this function
* anyway.
*/
nautilus_directory_unref (new_directory);
/* Update the file's name. */
name = nautilus_uri_get_basename (pair->to_uri);
@ -1189,9 +1195,6 @@ nautilus_directory_notify_files_moved (GList *uri_pairs)
(added_lists, new_directory, file);
}
nautilus_directory_unref (old_directory);
nautilus_directory_unref (new_directory);
/* Unref each file once to balance out nautilus_file_get. */
unref_list = g_list_prepend (unref_list, file);
}