[zeromq-dev] zmq_ctx_destroy() stocks forever when statically built on Windows

M.S. Babaei ace.of.zerosync at gmail.com
Wed Dec 19 12:25:41 CET 2012

Hi Folks,

I built ZeroMQ 3.2.2 on windows both static and dynamic release/debug
I use the C++ wrapper (zmq.hpp) from Github.
Both my client and server are running on the same machine (Windows 7) and I
built them with MSVC++ 10.
The dynamic version of the library works just fine for both client and

But I have to use the static version for one of my clients because it's a
game written on top of UDK.
We use the native code using this method:
And we have built all libraries statically with our code because of the

Now the problem is, whenever we want to close the context the game won't
exit and it stocks forever.
I thought maybe it's a bug in the C++ wrapper of ZeroMQ
then I decided to use the C bindings directly.

This is piece of our code:

Since it's unsafe to delete void* pointers is there any way to stop the
context which doesn't respect ZMQ_LINGERE.
Even simple code like this won't exit gracefully (no connect, no message):

But this one exits cleanly, which of course it's useless:

It's worth noting that I have just one socket in my app. And this code
works In my testbed which links dynamically.
Of course the static version works just fine, but the only glitch is the
exiting part. The game stocks forever at
rc = zmq_ctx_destroy(m_context); and the CPU usage varies between 25-50%.

And this is my log from building ZeroMQ statically for UDK dll-binding:

Thanks in Advance,
M.S. Babaei

*We are the puppets and fate the puppeteer / This is not a metaphor, but a
truth sincere / On this stage, fate for sometime our moves steer / Into the
chest of non-existence, one by one disappear.*
*-- Omar Khayyam*
*ما لعبتکانیم و فلک لعبت باز / از روی حقیقتی نه از روی مجاز / یک چند در این
بساط بازی کردیم / رفتیم به صندوق عدم یک یک باز*
*-- حکیم عمر خیام*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20121219/5bbd3038/attachment.htm>

More information about the zeromq-dev mailing list