From 6d87404ba3330909fca7cc2991ce5ecd20fdb745 Mon Sep 17 00:00:00 2001 From: Jim Keir Date: Wed, 13 Jun 2018 10:36:51 +0100 Subject: [PATCH] Use a normal failure instead of an assert when mailbox read fails. --- src/mailbox.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/mailbox.cpp b/src/mailbox.cpp index d1fd0653..79874bfc 100644 --- a/src/mailbox.cpp +++ b/src/mailbox.cpp @@ -78,7 +78,10 @@ int zmq::mailbox_t::recv (command_t *cmd_, int timeout_) // Get a command. errno_assert (rc == 0); + + // check_read says that this can fail during deallocation. So, instead of using + // the fatal zmq_assert, just return a normal failure. bool ok = cpipe.read (cmd_); - zmq_assert (ok); - return 0; + + return (ok ? 0 : -1); }