Unverified Commit 4ebe9233 authored by Luca Boccassi's avatar Luca Boccassi Committed by GitHub

Merge pull request #3687 from trya/fix_conflate

Fix behavior of ZMQ_CONFLATE on PUB sockets
parents 38b485dd 2fe9dd91
......@@ -78,12 +78,12 @@ template <> class dbuffer_t<msg_t>
msg_t &xvalue = const_cast<msg_t &> (value_);
zmq_assert (xvalue.check ());
_back->move (xvalue); // cannot just overwrite, might leak
*_back = value_;
zmq_assert (_back->check ());
if (_sync.try_lock ()) {
std::swap (_back, _front);
_front->move (*_back);
_has_msg = true;
_sync.unlock ();
......
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