fix invariant-check bug in peer_connection

This commit is contained in:
Arvid Norberg 2008-06-30 07:58:50 +00:00
parent d396ab7b17
commit 0e1d2ede70
1 changed files with 4 additions and 2 deletions

View File

@ -2510,11 +2510,13 @@ namespace libtorrent
void peer_connection::second_tick(float tick_interval)
{
INVARIANT_CHECK;
ptime now(time_now());
boost::intrusive_ptr<peer_connection> me(self());
// the invariant check must be run before me is destructed
// in case the peer got disconnected
INVARIANT_CHECK;
boost::shared_ptr<torrent> t = m_torrent.lock();
if (!t || m_disconnecting)
{