From: Charles Kerr Date: Sat, 19 Sep 2009 11:35:27 +0000 (+0000) Subject: (trunk gtk) #2427: crash on quit when the Preferences window is open X-Git-Tag: 1.80b5~734 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e4e263af984ffdef43367357ddc3093869209601;p=transmission (trunk gtk) #2427: crash on quit when the Preferences window is open --- diff --git a/gtk/file-list.c b/gtk/file-list.c index f5c29e8a9..5842e6705 100644 --- a/gtk/file-list.c +++ b/gtk/file-list.c @@ -204,7 +204,11 @@ gtr_tree_model_foreach_postorder( GtkTreeModel * model, static void refresh( FileData * data ) { - tr_torrent * tor = tr_torrentFindFromId( tr_core_session( data->core ), data->torrentId ); + tr_torrent * tor = NULL; + tr_session * session = tr_core_session( data->core ); + + if( session != NULL ) + tor = tr_torrentFindFromId( session, data->torrentId ); if( tor == NULL ) { @@ -213,7 +217,7 @@ refresh( FileData * data ) else { tr_file_index_t fileCount; - data->tor = tr_torrentFindFromId( tr_core_session( data->core ), data->torrentId ); + data->tor = tr_torrentFindFromId( session, data->torrentId ); data->refresh_file_stat = tr_torrentFiles( tor, &fileCount ); gtr_tree_model_foreach_postorder( data->model, refreshFilesForeach, data );