fix a possible crash on shutdown

This commit is contained in:
Charles Kerr 2008-02-13 01:33:29 +00:00
parent d360607a02
commit e20a5cf3df
1 changed files with 5 additions and 2 deletions

View File

@ -368,8 +368,11 @@ tr_closeImpl( void * vh )
tr_sharedShuttingDown( h->shared );
tr_trackerShuttingDown( h );
for( t=h->torrentList; t!=NULL; t=t->next )
tr_torrentClose( t );
for( t=h->torrentList; t!=NULL; ) {
tr_torrent * tmp = t;
t = t->next;
tr_torrentClose( tmp );
}
tr_peerMgrFree( h->peerMgr );