Add explicit close method to context_t

This commit is contained in:
Richard Newton 2012-08-28 13:49:14 +01:00
parent f957e25a3f
commit ce3e3e2f9a

View File

@ -236,11 +236,17 @@ namespace zmq
#endif
inline ~context_t ()
{
close();
}
inline void close()
{
if (ptr == NULL)
return;
int rc = zmq_term (ptr);
ZMQ_ASSERT (rc == 0);
ptr = NULL;
}
// Be careful with this, it's probably only useful for