mirror of
https://github.com/zeromq/cppzmq.git
synced 2025-01-19 00:46:05 +01:00
Assertion in dtor of context_t doesn't fail if close method has already been called
This commit is contained in:
parent
92d2af6def
commit
8214a500d9
7
zmq.hpp
7
zmq.hpp
@ -410,14 +410,17 @@ namespace zmq
|
||||
|
||||
inline ~context_t () ZMQ_NOTHROW
|
||||
{
|
||||
int rc = zmq_ctx_destroy (ptr);
|
||||
ZMQ_ASSERT (rc == 0);
|
||||
close();
|
||||
}
|
||||
|
||||
inline void close() ZMQ_NOTHROW
|
||||
{
|
||||
if (ptr == NULL)
|
||||
return;
|
||||
|
||||
int rc = zmq_ctx_destroy (ptr);
|
||||
ZMQ_ASSERT (rc == 0);
|
||||
ptr = NULL;
|
||||
}
|
||||
|
||||
// Be careful with this, it's probably only useful for
|
||||
|
Loading…
x
Reference in New Issue
Block a user