We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b946c18 commit 412790cCopy full SHA for 412790c
1 file changed
src/pipe.cpp
@@ -359,16 +359,18 @@ void zmq::pipe_t::process_pipe_term_ack ()
359
// First, delete all the unread messages in the pipe. We have to do it by
360
// hand because msg_t doesn't have automatic destructor. Then deallocate
361
// the ypipe itself.
362
+ upipe_t *const in_pipe = _in_pipe;
363
+ _in_pipe = NULL;
364
- if (!_conflate) {
365
+ if (!_conflate && in_pipe) {
366
msg_t msg;
- while (_in_pipe->read (&msg)) {
367
+ while (in_pipe->read (&msg)) {
368
const int rc = msg.close ();
369
errno_assert (rc == 0);
370
}
371
372
- LIBZMQ_DELETE (_in_pipe);
373
+ delete in_pipe;
374
375
// Deallocate the pipe object
376
delete this;
0 commit comments