Merge pull request #4 from ssiloti/master

Release alert manager mutex before notifying plugins
This commit is contained in:
Arvid Norberg 2015-06-15 22:11:07 -04:00
commit 75fa65f922
1 changed files with 12 additions and 7 deletions

View File

@ -73,13 +73,6 @@ namespace libtorrent
void alert_manager::maybe_notify(alert* a, mutex::scoped_lock& lock)
{
#ifndef TORRENT_DISABLE_EXTENSIONS
for (ses_extension_list_t::iterator i = m_ses_extensions.begin()
, end(m_ses_extensions.end()); i != end; ++i)
{
(*i)->on_alert(a);
}
#endif
if (a->type() == save_resume_data_failed_alert::alert_type
|| a->type() == save_resume_data_alert::alert_type)
++m_num_queued_resume;
@ -98,6 +91,18 @@ namespace libtorrent
// > 0 notify them
m_condition.notify_all();
}
else
{
lock.unlock();
}
#ifndef TORRENT_DISABLE_EXTENSIONS
for (ses_extension_list_t::iterator i = m_ses_extensions.begin()
, end(m_ses_extensions.end()); i != end; ++i)
{
(*i)->on_alert(a);
}
#endif
}
#ifndef TORRENT_NO_DEPRECATE