mirror of
https://github.com/zeromq/libzmq.git
synced 2024-12-28 07:58:14 +08:00
honor buffer reference count in zmq::shared_message_memory_allocator::deallocate
This commit is contained in:
parent
f1e6cb8ba9
commit
06e882f8ea
@ -96,10 +96,11 @@ unsigned char* zmq::shared_message_memory_allocator::allocate ()
|
||||
|
||||
void zmq::shared_message_memory_allocator::deallocate ()
|
||||
{
|
||||
std::free (buf);
|
||||
buf = NULL;
|
||||
bufsize = 0;
|
||||
msg_refcnt = NULL;
|
||||
zmq::atomic_counter_t* c = reinterpret_cast<zmq::atomic_counter_t* >(buf);
|
||||
if (buf && !c->sub(1)) {
|
||||
std::free(buf);
|
||||
}
|
||||
release();
|
||||
}
|
||||
|
||||
unsigned char* zmq::shared_message_memory_allocator::release ()
|
||||
|
Loading…
x
Reference in New Issue
Block a user