From 2d7875385e00f5e8ad66db1bc1dd5c44d222a5a9 Mon Sep 17 00:00:00 2001 From: Steven Siloti Date: Mon, 30 Mar 2020 15:01:55 -0700 Subject: [PATCH] fix assertion failure when detroying moved-from session When a session object is moved, all of its shared_ptrs become empty. Don't assert in the dtor due to this, just do nothing. --- src/session.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/session.cpp b/src/session.cpp index eb08d5ce0..0a47f993e 100644 --- a/src/session.cpp +++ b/src/session.cpp @@ -384,8 +384,9 @@ namespace { session::~session() { + if (!m_impl) return; + aux::dump_call_profile(); - TORRENT_ASSERT(m_impl); // capture the shared_ptr in the dispatched function // to keep the session_impl alive