0
0
mirror of https://github.com/zeromq/libzmq.git synced 2025-01-14 09:47:56 +08:00

Update decoder_allocators.cpp

zmq::shared_message_memory_allocator::deallocate () need to descontruct the object created by new operator.
This commit is contained in:
Qqzk 2021-11-03 22:25:02 +08:00 committed by Luca Boccassi
parent 8f238ae0b4
commit bb7a1cc018

View File

@ -102,6 +102,7 @@ void zmq::shared_message_memory_allocator::deallocate ()
{
zmq::atomic_counter_t *c = reinterpret_cast<zmq::atomic_counter_t *> (_buf);
if (_buf && !c->sub (1)) {
c->~atomic_counter_t();
std::free (_buf);
}
clear ();