diff --git a/src/mailbox.cpp b/src/mailbox.cpp index d2eff56f..fc09338c 100644 --- a/src/mailbox.cpp +++ b/src/mailbox.cpp @@ -33,6 +33,11 @@ zmq::mailbox_t::mailbox_t () zmq::mailbox_t::~mailbox_t () { // TODO: Retrieve and deallocate commands inside the cpipe. + + // Work around problem that other threads might still be in our + // send() method, by waiting on the mutex before disappearing. + sync.lock (); + sync.unlock (); } zmq::fd_t zmq::mailbox_t::get_fd ()