[zeromq-dev] czmq : mutiple init / shut down

brunobodin . brunobodin at gmail.com
Fri Mar 24 12:16:34 CET 2017


I'd like to be able to perform mutiple czmq init / shutdown in a process.
This works without an issue in ZMQ (create/term context), but in CZMQ I
have the following issues :
(czmq is compiled as a windows dll)

* first I had to slightly modify the shutdown funtion to reset the ctx
pointer  to null :

at line 265 of zsys.c :

 if (s_open_sockets == 0)
      s_process_ctx = NULL; // add this so next zsys_init() does not assert

so that the next zsys_init works (or seems to...)

* now the crash is in the second shutdown, to be precise in
zmq::ctx_t::terminate , on the "delete this" line  (line 215)

the test case is just

zsys_shutdown() // -> crash

I do not see where to look further, any hint appreciated !

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20170324/106b25c4/attachment.htm>

More information about the zeromq-dev mailing list