Skip to content

Commit

Permalink
Fixed a bug in frame's move assignment operator.
Browse files Browse the repository at this point in the history
The zmq_msg_init() at the beginning created a new message overwriting
the handle of the old message. But this old message was not closed
leaving a memory leak behind. Instead of closing the existing handle
explicitly we can simply remove the init call because zmq_msg_move()
does the closing of the old message on its own.

see zeromq#204
  • Loading branch information
rcane committed Jun 15, 2023
1 parent ba4230d commit e888c14
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/zmqpp/frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ frame::frame(frame&& other)

frame& frame::operator=(frame&& other)
{
zmq_msg_init( &_msg );
zmq_msg_move( &_msg, &other._msg );
std::swap( _sent, other._sent );

Expand Down

0 comments on commit e888c14

Please sign in to comment.