Closed rainbow-alex closed 10 years ago
This is by design and even if intuitively feels possible it's not really the case. Specifically on Windows some close operations take time. Also this makes the interface more consistent across libuv.
You'll have to allocate the handle on the heap and free it on the close callback.
I am using libuv in combination with coroutines. What I am trying to do is:
The problem with the last step is the closing happens asynchronously. By the time the loop gets to closing my handle, the allocation is invalid. I suppose I could work around this by allocating the handle on the heap and using the close callback to free it, but it would be nice if I could just
uv_close_sync( &my_handle );
. Intuitively it seems feasible.