honor proper object lifetime rules
This commit is contained in:
parent
9c970550e3
commit
4b8f8d7e92
|
@ -104,6 +104,7 @@ public:
|
||||||
|
|
||||||
auto deleter = [this](observer* o)
|
auto deleter = [this](observer* o)
|
||||||
{
|
{
|
||||||
|
TORRENT_ASSERT(o->m_in_use);
|
||||||
o->~observer();
|
o->~observer();
|
||||||
free_observer(o);
|
free_observer(o);
|
||||||
};
|
};
|
||||||
|
|
|
@ -200,7 +200,6 @@ void rpc_manager::free_observer(void* ptr)
|
||||||
{
|
{
|
||||||
if (ptr == nullptr) return;
|
if (ptr == nullptr) return;
|
||||||
--m_allocated_observers;
|
--m_allocated_observers;
|
||||||
TORRENT_ASSERT(reinterpret_cast<observer*>(ptr)->m_in_use == false);
|
|
||||||
m_pool_allocator.free(ptr);
|
m_pool_allocator.free(ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue