honor proper object lifetime rules

This commit is contained in:
arvidn 2019-09-27 17:02:00 +02:00 committed by Arvid Norberg
parent 9c970550e3
commit 4b8f8d7e92
2 changed files with 1 additions and 1 deletions

View File

@ -104,6 +104,7 @@ public:
auto deleter = [this](observer* o)
{
TORRENT_ASSERT(o->m_in_use);
o->~observer();
free_observer(o);
};

View File

@ -200,7 +200,6 @@ void rpc_manager::free_observer(void* ptr)
{
if (ptr == nullptr) return;
--m_allocated_observers;
TORRENT_ASSERT(reinterpret_cast<observer*>(ptr)->m_in_use == false);
m_pool_allocator.free(ptr);
}