Skip to content

Commit e888c14

Browse files
committed
Fixed a bug in frame's move assignment operator.
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
1 parent ba4230d commit e888c14

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

src/zmqpp/frame.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ frame::frame(frame&& other)
8181

8282
frame& frame::operator=(frame&& other)
8383
{
84-
zmq_msg_init( &_msg );
8584
zmq_msg_move( &_msg, &other._msg );
8685
std::swap( _sent, other._sent );
8786

0 commit comments

Comments
 (0)