Commit cdd7cd10 authored by Ian Barber's avatar Ian Barber

Merge pull request #456 from hurtonm/issue_464

Resolve LIBZMQ-464
parents 04e716ac 7c66e8f8
...@@ -283,7 +283,14 @@ bool zmq::msg_t::rm_refs (int refs_) ...@@ -283,7 +283,14 @@ bool zmq::msg_t::rm_refs (int refs_)
// The only message type that needs special care are long messages. // The only message type that needs special care are long messages.
if (!u.lmsg.content->refcnt.sub (refs_)) { if (!u.lmsg.content->refcnt.sub (refs_)) {
close (); // We used "placement new" operator to initialize the reference
// counter so we call the destructor explicitly now.
u.lmsg.content->refcnt.~atomic_counter_t ();
if (u.lmsg.content->ffn)
u.lmsg.content->ffn (u.lmsg.content->data, u.lmsg.content->hint);
free (u.lmsg.content);
return false; return false;
} }
......
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