fix assert

This commit is contained in:
Arvid Norberg
2013-05-17 05:03:33 +00:00
parent b6eb5d7476
commit 1ad2bc42a1

View File

@@ -216,11 +216,7 @@ void* rpc_manager::allocate_observer()
{ {
m_pool_allocator.set_next_size(10); m_pool_allocator.set_next_size(10);
void* ret = m_pool_allocator.malloc(); void* ret = m_pool_allocator.malloc();
if (ret) if (ret) ++m_allocated_observers;
{
++m_allocated_observers;
TORRENT_ASSERT(reinterpret_cast<observer*>(ret)->m_in_use == false);
}
return ret; return ret;
} }
@@ -228,7 +224,7 @@ void rpc_manager::free_observer(void* ptr)
{ {
if (!ptr) return; if (!ptr) return;
--m_allocated_observers; --m_allocated_observers;
TORRENT_ASSERT(reinterpret_cast<observer*>(ptr)->m_in_use == true); TORRENT_ASSERT(reinterpret_cast<observer*>(ptr)->m_in_use == false);
m_pool_allocator.free(ptr); m_pool_allocator.free(ptr);
} }