diff --git a/src/torrent_handle.cpp b/src/torrent_handle.cpp index 87868855d..15a7a41c4 100644 --- a/src/torrent_handle.cpp +++ b/src/torrent_handle.cpp @@ -728,6 +728,7 @@ namespace libtorrent entry ret(entry::dictionary_t); TORRENT_SYNC_CALL1(write_resume_data, boost::ref(ret)); + t = m_torrent.lock(); if (t) { bool done = false; @@ -737,6 +738,7 @@ namespace libtorrent ses.m_io_service.post(boost::bind(&fun_wrap, &done, &ses.cond , &ses.mut, boost::function(boost::bind( &piece_manager::write_resume_data, &t->filesystem(), boost::ref(ret))))); + t.reset(); do { ses.cond.wait(l); } while(!done); }