From b0ee6b0c8ab8a5052a5e111dda24308dd00c0d62 Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Sun, 7 Feb 2010 11:31:05 +0100 Subject: ZMQII-62: zmq_close after sending message via P2P socket fails --- src/p2p.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/p2p.cpp b/src/p2p.cpp index 9a5e186..72bc26b 100644 --- a/src/p2p.cpp +++ b/src/p2p.cpp @@ -93,6 +93,11 @@ int zmq::p2p_t::xsend (zmq_msg_t *msg_, int flags_) outpipe->write (msg_); if (!(flags_ & ZMQ_NOFLUSH)) outpipe->flush (); + + // Detach the original message from the data buffer. + int rc = zmq_msg_init (msg_); + zmq_assert (rc == 0); + return 0; } -- cgit v1.2.3