fixed release asserts issue in kademlia code

This commit is contained in:
Arvid Norberg 2012-01-16 22:48:43 +00:00
parent dbe0554458
commit d52eb9ed19
4 changed files with 5 additions and 5 deletions

View File

@ -196,7 +196,7 @@ observer_ptr find_data::new_observer(void* ptr
, udp::endpoint const& ep, node_id const& id) , udp::endpoint const& ep, node_id const& id)
{ {
observer_ptr o(new (ptr) find_data_observer(this, ep, id)); observer_ptr o(new (ptr) find_data_observer(this, ep, id));
#ifdef TORRENT_DEBUG #if defined TORRENT_DEBUG || TORRENT_RELEASE_ASSERTS
o->m_in_constructor = false; o->m_in_constructor = false;
#endif #endif
return o; return o;

View File

@ -273,7 +273,7 @@ namespace
void* ptr = node.m_rpc.allocate_observer(); void* ptr = node.m_rpc.allocate_observer();
if (ptr == 0) return; if (ptr == 0) return;
observer_ptr o(new (ptr) announce_observer(algo, i->first.ep(), i->first.id)); observer_ptr o(new (ptr) announce_observer(algo, i->first.ep(), i->first.id));
#ifdef TORRENT_DEBUG #if defined TORRENT_DEBUG || TORRENT_RELEASE_ASSERTS
o->m_in_constructor = false; o->m_in_constructor = false;
#endif #endif
entry e; entry e;
@ -310,7 +310,7 @@ void node_impl::add_node(udp::endpoint node)
boost::intrusive_ptr<traversal_algorithm> algo( boost::intrusive_ptr<traversal_algorithm> algo(
new traversal_algorithm(*this, (node_id::min)())); new traversal_algorithm(*this, (node_id::min)()));
observer_ptr o(new (ptr) null_observer(algo, node, node_id(0))); observer_ptr o(new (ptr) null_observer(algo, node, node_id(0)));
#ifdef TORRENT_DEBUG #if defined TORRENT_DEBUG || TORRENT_RELEASE_ASSERTS
o->m_in_constructor = false; o->m_in_constructor = false;
#endif #endif
entry e; entry e;

View File

@ -62,7 +62,7 @@ observer_ptr refresh::new_observer(void* ptr
, udp::endpoint const& ep, node_id const& id) , udp::endpoint const& ep, node_id const& id)
{ {
observer_ptr o(new (ptr) find_data_observer(this, ep, id)); observer_ptr o(new (ptr) find_data_observer(this, ep, id));
#ifdef TORRENT_DEBUG #if defined TORRENT_DEBUG || TORRENT_RELEASE_ASSERTS
o->m_in_constructor = false; o->m_in_constructor = false;
#endif #endif
return o; return o;

View File

@ -53,7 +53,7 @@ observer_ptr traversal_algorithm::new_observer(void* ptr
, udp::endpoint const& ep, node_id const& id) , udp::endpoint const& ep, node_id const& id)
{ {
observer_ptr o(new (ptr) null_observer(boost::intrusive_ptr<traversal_algorithm>(this), ep, id)); observer_ptr o(new (ptr) null_observer(boost::intrusive_ptr<traversal_algorithm>(this), ep, id));
#ifdef TORRENT_DEBUG #if defined TORRENT_DEBUG || TORRENT_RELEASE_ASSERTS
o->m_in_constructor = false; o->m_in_constructor = false;
#endif #endif
return o; return o;