(gtk) fix potential invalid memory read on shutdown

This commit is contained in:
Charles Kerr
2008-04-17 20:35:18 +00:00
parent 101307ddff
commit 3e88159e9f
4 changed files with 24 additions and 7 deletions

View File

@@ -551,6 +551,17 @@ tr_core_new( void )
return core;
}
void
tr_core_close( TrCore * core )
{
tr_handle * handle = tr_core_handle( core );
if( handle )
{
core->priv->handle = NULL;
tr_close( handle );
}
}
GtkTreeModel *
tr_core_model( TrCore * core )
{
@@ -595,6 +606,7 @@ tr_core_get_stats( const TrCore * core,
tr_torrentRates( core->priv->handle,
&setme->clientDownloadSpeed,
&setme->clientUploadSpeed );
gtk_tree_model_foreach( core->priv->model,
statsForeach,
setme );