From ccd75006d49700557181897ab3da3447a83042f7 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sun, 5 Oct 2008 23:36:50 +0000 Subject: [PATCH] fixed failing invariant check caused by a life-time issue in debug mode --- src/peer_connection.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/peer_connection.cpp b/src/peer_connection.cpp index f628076b5..bf0a6a501 100644 --- a/src/peer_connection.cpp +++ b/src/peer_connection.cpp @@ -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 me(self()); +#endif INVARIANT_CHECK; error_code ec;