Merge pull request #3687 from trya/fix_conflate

Fix behavior of ZMQ_CONFLATE on PUB sockets
This commit is contained in:
Luca Boccassi 2019-09-24 11:45:15 +01:00 committed by GitHub
commit 4ebe92333e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 ();