mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-20 22:31:33 +02:00
advance refcnt only if it was used
This commit is contained in:
@@ -129,11 +129,12 @@ int zmq::v2_decoder_t::size_ready(uint64_t msg_size, unsigned char const* read_p
|
||||
// if the message will be a large message, pass a valid refcnt memory location as well
|
||||
rc = in_progress.init( (unsigned char*)read_pos, msg_size,
|
||||
shared_message_memory_allocator::call_dec_ref, buffer(),
|
||||
create_refcnt() );
|
||||
provide_refcnt() );
|
||||
|
||||
// For small messages, data has been copied and refcount does not have to be increased
|
||||
if (in_progress.is_zcmsg())
|
||||
{
|
||||
advance_refcnt();
|
||||
inc_ref();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user