mirror of
https://gitlab.gnome.org/GNOME/nautilus
synced 2024-11-05 16:04:31 +00:00
file-view: prevent ref unreffed pending selection objects
Do the selection unref after that we've copied it, as the very same objects might be in two different lists and thus being invalidated after the first unref. Fixes #295
This commit is contained in:
parent
61c317f44f
commit
115acfb9d3
1 changed files with 5 additions and 2 deletions
|
@ -3032,6 +3032,7 @@ nautilus_files_view_set_selection (NautilusView *nautilus_files_view,
|
|||
{
|
||||
NautilusFilesView *view;
|
||||
NautilusFilesViewPrivate *priv;
|
||||
GList *pending_selection;
|
||||
|
||||
view = NAUTILUS_FILES_VIEW (nautilus_files_view);
|
||||
priv = nautilus_files_view_get_instance_private (view);
|
||||
|
@ -3049,9 +3050,11 @@ nautilus_files_view_set_selection (NautilusView *nautilus_files_view,
|
|||
/* If we are still loading, set the list of pending URIs instead.
|
||||
* done_loading() will eventually select the pending URIs and reveal them.
|
||||
*/
|
||||
pending_selection = g_list_copy_deep (selection,
|
||||
(GCopyFunc) g_object_ref, NULL);
|
||||
g_list_free_full (priv->pending_selection, g_object_unref);
|
||||
priv->pending_selection =
|
||||
g_list_copy_deep (selection, (GCopyFunc) g_object_ref, NULL);
|
||||
|
||||
priv->pending_selection = pending_selection;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue