Commit c391bc06 authored by Christian Neumair's avatar Christian Neumair Committed by Christian Neumair
Browse files

Ensure that the rename file callback data is destroyed. We leaked it in

2008-03-24  Christian Neumair  <cneumair@gnome.org>

	* src/file-manager/fm-directory-view.c
	(delayed_rename_file_hack_callback),
	(delayed_rename_file_hack_removed), (rename_file):
	Ensure that the rename file callback data is destroyed. We leaked it
	in case of cancellation.

svn path=/trunk/; revision=13982
parent 97646d19
2008-03-24 Christian Neumair <cneumair@gnome.org>
* src/file-manager/fm-directory-view.c
(delayed_rename_file_hack_callback),
(delayed_rename_file_hack_removed), (rename_file):
Ensure that the rename file callback data is destroyed. We leaked it
in case of cancellation.
2008-03-23 Christian Neumair <cneumair@gnome.org>
* src/file-manager/fm-directory-view.c
......
......@@ -3662,14 +3662,19 @@ delayed_rename_file_hack_callback (RenameData *data)
EEL_CALL_METHOD (FM_DIRECTORY_VIEW_CLASS, view, start_renaming_file, (view, new_file, FALSE));
fm_directory_view_reveal_selection (view);
}
return FALSE;
}
static void
delayed_rename_file_hack_removed (RenameData *data)
{
g_object_unref (data->view);
nautilus_file_unref (data->new_file);
g_free (data);
return FALSE;
}
static void
rename_file (FMDirectoryView *view, NautilusFile *new_file)
{
......@@ -3695,8 +3700,9 @@ rename_file (FMDirectoryView *view, NautilusFile *new_file)
g_source_remove (view->details->delayed_rename_file_id);
}
view->details->delayed_rename_file_id =
g_timeout_add (100, (GSourceFunc)delayed_rename_file_hack_callback,
data);
g_timeout_add_full (G_PRIORITY_DEFAULT,
100, (GSourceFunc)delayed_rename_file_hack_callback,
data, (GDestroyNotify) delayed_rename_file_hack_removed);
return;
}
......
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