fix etensions being passed all alerts
This commit is contained in:
parent
23e5fd3d8f
commit
20aa53953c
|
@ -87,7 +87,7 @@ namespace libtorrent {
|
|||
T alert(m_allocations[m_generation], std::forward<Args>(args)...);
|
||||
m_alerts[m_generation].push_back(alert);
|
||||
|
||||
maybe_notify(lock);
|
||||
maybe_notify(&alert, lock);
|
||||
}
|
||||
|
||||
#else
|
||||
|
@ -157,7 +157,7 @@ namespace libtorrent {
|
|||
alert_manager(alert_manager const&);
|
||||
alert_manager& operator=(alert_manager const&);
|
||||
|
||||
void maybe_notify(mutex::scoped_lock& lock);
|
||||
void maybe_notify(alert* a, mutex::scoped_lock& lock);
|
||||
|
||||
mutable mutex m_mutex;
|
||||
condition_variable m_condition;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
|
||||
#if !BOOST_PP_IS_ITERATING
|
||||
|
||||
// set-up iteration
|
||||
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
|
@ -47,7 +46,7 @@
|
|||
BOOST_PP_ENUM_PARAMS(I, a));
|
||||
m_alerts[m_generation].push_back(alert);
|
||||
|
||||
maybe_notify(lock);
|
||||
maybe_notify(&alert, lock);
|
||||
}
|
||||
|
||||
#undef I
|
||||
|
|
|
@ -71,9 +71,15 @@ namespace libtorrent
|
|||
return NULL;
|
||||
}
|
||||
|
||||
void alert_manager::maybe_notify(mutex::scoped_lock& lock)
|
||||
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 (m_alerts[m_generation].size() == 1)
|
||||
{
|
||||
lock.unlock();
|
||||
|
|
Loading…
Reference in New Issue