Prevent exception to be thrown in the destructor

The only defined error code for zmq_close() is ENOTSOCK
which indicates an error in cppzmq implementation.
It's ok to use assert here instead of throw.

Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
This commit is contained in:
Martin Sustrik 2012-01-31 11:11:34 +09:00
parent 729aaad079
commit 73fd092572

View File

@ -275,8 +275,7 @@ namespace zmq
// already closed
return ;
int rc = zmq_close (ptr);
if (rc != 0)
throw error_t ();
assert (rc == 0);
ptr = 0 ;
}