mirror of
https://github.com/transmission/transmission
synced 2025-02-03 21:12:05 +00:00
(trunk gtk) #2668 "small memory leak in getSelectedTorrentIds()" -- fixed for 1.80
This commit is contained in:
parent
ee0de4b06c
commit
8e0e62187d
1 changed files with 5 additions and 2 deletions
|
@ -134,12 +134,12 @@ getSelectedTorrentIds( struct cbdata * data )
|
|||
GtkTreeSelection * s;
|
||||
GtkTreeModel * model;
|
||||
GSList * ids = NULL;
|
||||
GList * selrows = NULL;
|
||||
GList * paths = NULL;
|
||||
GList * l;
|
||||
|
||||
/* build a list of the selected torrents' ids */
|
||||
s = tr_window_get_selection( data->wind );
|
||||
for( selrows=l=gtk_tree_selection_get_selected_rows(s,&model); l; l=l->next ) {
|
||||
for( paths=l=gtk_tree_selection_get_selected_rows(s,&model); l; l=l->next ) {
|
||||
GtkTreeIter iter;
|
||||
if( gtk_tree_model_get_iter( model, &iter, l->data ) ) {
|
||||
tr_torrent * tor;
|
||||
|
@ -148,6 +148,9 @@ getSelectedTorrentIds( struct cbdata * data )
|
|||
}
|
||||
}
|
||||
|
||||
/* cleanup */
|
||||
g_list_foreach( paths, (GFunc)gtk_tree_path_free, NULL );
|
||||
g_list_free( paths );
|
||||
return ids;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue