Commit 30433daf authored by John Sullivan's avatar John Sullivan

Fixed mistake in recent bug fix.

parent 0d911a35
2000-03-09 John Sullivan <sullivan@eazel.com>
* libnautilus/nautilus-file.c:
(nautilus_file_unref): Got this fix wrong last time, causing
GTK-CRITICALs when deleting files. Remember file->is_gone
before unreffing directory since you can't test possibly-destroyed
file afterward.
2000-03-09 John Sullivan <sullivan@eazel.com>
* libnautilus/nautilus-directory-private.h:
......
......@@ -148,6 +148,8 @@ nautilus_file_ref (NautilusFile *file)
void
nautilus_file_unref (NautilusFile *file)
{
gboolean goner;
g_return_if_fail (file != NULL);
g_assert (file->ref_count != 0);
......@@ -158,11 +160,17 @@ nautilus_file_unref (NautilusFile *file)
return;
}
goner = file->is_gone;
/* No references left, so it's time to release our hold on the directory. */
if (file->is_gone) {
gtk_object_unref (GTK_OBJECT (file->directory));
if (goner) {
/* Files that were deleted aren't referenced by the directory,
* need to free it explicitly.
*/
nautilus_file_free (file);
}
gtk_object_unref (GTK_OBJECT (file->directory));
}
void
......
......@@ -148,6 +148,8 @@ nautilus_file_ref (NautilusFile *file)
void
nautilus_file_unref (NautilusFile *file)
{
gboolean goner;
g_return_if_fail (file != NULL);
g_assert (file->ref_count != 0);
......@@ -158,11 +160,17 @@ nautilus_file_unref (NautilusFile *file)
return;
}
goner = file->is_gone;
/* No references left, so it's time to release our hold on the directory. */
if (file->is_gone) {
gtk_object_unref (GTK_OBJECT (file->directory));
if (goner) {
/* Files that were deleted aren't referenced by the directory,
* need to free it explicitly.
*/
nautilus_file_free (file);
}
gtk_object_unref (GTK_OBJECT (file->directory));
}
void
......
......@@ -148,6 +148,8 @@ nautilus_file_ref (NautilusFile *file)
void
nautilus_file_unref (NautilusFile *file)
{
gboolean goner;
g_return_if_fail (file != NULL);
g_assert (file->ref_count != 0);
......@@ -158,11 +160,17 @@ nautilus_file_unref (NautilusFile *file)
return;
}
goner = file->is_gone;
/* No references left, so it's time to release our hold on the directory. */
if (file->is_gone) {
gtk_object_unref (GTK_OBJECT (file->directory));
if (goner) {
/* Files that were deleted aren't referenced by the directory,
* need to free it explicitly.
*/
nautilus_file_free (file);
}
gtk_object_unref (GTK_OBJECT (file->directory));
}
void
......
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