mirror of
https://github.com/zeromq/cppzmq.git
synced 2024-12-13 10:52:57 +01:00
Fixes assertion error, when destroing ctx while creating a socket from a different thread: ./src/mutex.hpp:123
This commit is contained in:
parent
fa2f2c67a7
commit
971092e472
8
zmq.hpp
8
zmq.hpp
@ -372,16 +372,14 @@ namespace zmq
|
|||||||
|
|
||||||
inline ~context_t () ZMQ_NOTHROW
|
inline ~context_t () ZMQ_NOTHROW
|
||||||
{
|
{
|
||||||
close();
|
int rc = zmq_ctx_destroy (ptr);
|
||||||
|
ZMQ_ASSERT (rc == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void close() ZMQ_NOTHROW
|
inline void close() ZMQ_NOTHROW
|
||||||
{
|
{
|
||||||
if (ptr == NULL)
|
int rc = zmq_ctx_shutdown (ptr);
|
||||||
return;
|
|
||||||
int rc = zmq_ctx_destroy (ptr);
|
|
||||||
ZMQ_ASSERT (rc == 0);
|
ZMQ_ASSERT (rc == 0);
|
||||||
ptr = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Be careful with this, it's probably only useful for
|
// Be careful with this, it's probably only useful for
|
||||||
|
Loading…
Reference in New Issue
Block a user