add: if (current != NULL) { gtk_tree_path_free (playlist->_priv->current); playlist->_priv->current = gtk_tree_row_reference_get_path (current); gtk_tree_row_reference_free (current); }
context: gtk_playlist_move_files (GtkPlaylist *playlist, gboolean direction_up){	GtkTreeSelection *selection;	GtkTreeModel *model;	GtkListStore *store;	GtkTreeIter iter;	GList *paths, *refs, *l;	int pos;	selection = gtk_tree_view_get_selection		(GTK_TREE_VIEW (playlist->_priv->treeview));	if (selection == NULL)		return;	model = gtk_tree_view_get_model		(GTK_TREE_VIEW (playlist->_priv->treeview));	store = GTK_LIST_STORE (model);	pos = -2;	refs = NULL;	/* Build a list of tree references */	paths = gtk_tree_selection_get_selected_rows (selection, NULL);	for (l = paths; l != NULL; l = l->next)	{		GtkTreePath *path = l->data;		int cur_pos, *indices;		refs = g_list_prepend (refs,				gtk_tree_row_reference_new (model, path));		indices = gtk_tree_path_get_indices (path);		cur_pos = indices[0];		if (pos == -2)		{			pos = cur_pos;		} else {			if (direction_up == FALSE)				pos = MAX (cur_pos, pos);			else				pos = MIN (cur_pos, pos);		}	}	g_list_foreach (paths, (GFunc) gtk_tree_path_free, NULL);	g_list_free (paths);	refs = g_list_reverse (refs);	if (direction_up == FALSE)		pos = pos + 2;	else		pos = pos - 2;	for (l = refs; l != NULL; l = l->next)	{		GtkTreeIter *position, current;		GtkTreeRowReference *ref = l->data;		GtkTreePath *path;		if (pos < 0)		{			position = NULL;		} else {			char *str;			str = g_strdup_printf ("%d", pos);			if (gtk_tree_model_get_iter_from_string (model,					&iter, str))				position = &iter;			else				position = NULL;			g_free (str);		}		path = gtk_tree_row_reference_get_path (ref);		gtk_tree_model_get_iter (model, &current, path);		gtk_tree_path_free (path);		if (direction_up == FALSE)		{			pos--;			gtk_list_store_move_before (store, &current, position);		} else {			gtk_list_store_move_after (store, &current, position);			pos++;		}	}	g_list_foreach (refs, (GFunc) gtk_tree_row_reference_free, NULL);	g_list_free (refs);	g_signal_emit (G_OBJECT (playlist),			gtk_playlist_table_signals[CHANGED], 0,			NULL);}