fixed bug in torrent_handle::write_resume_data since the session mutex was removed

This commit is contained in:
Arvid Norberg 2010-07-24 17:10:45 +00:00
parent 7c5ca7712a
commit b0a3b2545b
1 changed files with 2 additions and 0 deletions

View File

@ -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<void(void)>(boost::bind(
&piece_manager::write_resume_data, &t->filesystem(), boost::ref(ret)))));
t.reset();
do { ses.cond.wait(l); } while(!done);
}