fixed failing invariant check caused by a life-time issue in debug mode

This commit is contained in:
Arvid Norberg 2008-10-05 23:36:50 +00:00
parent f6a1e467a8
commit ccd75006d4
1 changed files with 6 additions and 0 deletions

View File

@ -3608,6 +3608,12 @@ namespace libtorrent
void peer_connection::connect(int ticket)
{
#ifndef NDEBUG
// in case we disconnect here, we need to
// keep the connection alive until the
// exit invariant check is run
boost::intrusive_ptr<peer_connection> me(self());
#endif
INVARIANT_CHECK;
error_code ec;