Commit 979e6bb4 authored by Pieter Hintjens's avatar Pieter Hintjens

Merge pull request #1613 from maxkozlovsky/master

honor buffer reference count in zmq::shared_message_memory_allocator:…
parents f1e6cb8b 06e882f8
......@@ -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 ()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment