We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 92d2af6 + 8214a50 commit 7faa9b0Copy full SHA for 7faa9b0
zmq.hpp
@@ -410,14 +410,17 @@ namespace zmq
410
411
inline ~context_t () ZMQ_NOTHROW
412
{
413
- int rc = zmq_ctx_destroy (ptr);
414
- ZMQ_ASSERT (rc == 0);
+ close();
415
}
416
417
inline void close() ZMQ_NOTHROW
418
+ if (ptr == NULL)
419
+ return;
420
+
421
int rc = zmq_ctx_destroy (ptr);
422
ZMQ_ASSERT (rc == 0);
423
+ ptr = NULL;
424
425
426
// Be careful with this, it's probably only useful for
0 commit comments