mirror of
https://github.com/zeromq/libzmq.git
synced 2025-11-06 21:56:25 +01:00
advance refcnt only if it was used
This commit is contained in:
@@ -63,11 +63,12 @@ int zmq::raw_decoder_t::decode (const uint8_t *data_, size_t size_,
|
||||
int rc = in_progress.init ((unsigned char*)data_, size_,
|
||||
shared_message_memory_allocator::call_dec_ref,
|
||||
allocator.buffer(),
|
||||
allocator.create_refcnt() );
|
||||
allocator.provide_refcnt() );
|
||||
|
||||
// if the buffer serves as memory for a zero-copy message, release it
|
||||
// and allocate a new buffer in get_buffer for the next decode
|
||||
if (in_progress.is_zcmsg()) {
|
||||
allocator.advance_refcnt();
|
||||
allocator.release();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user