joyent/libuv — Issue #319: call uv_close() callbacks that are registered post-return from uv_run()
Author: olsonjeffery
Created: 2012-02-21 14:16:38+00:00
State: open

If I have a handler that was added to the loop, but is not keeping the loop from exiting (via uv_unref() ), I'd like to still be able to use uv_close(), after uv_run() returns, to register a callback to be processed once any libuv-managed memory/descriptors linked to the handle have been released.

Right now, it appears that a callback registered as such isn't executed (in my testing with a uv_async_t). So I'm left to immediately free the handle's data/ptr after uv_close() (it's still a safe call) returns, which bnoordhuis classified as a "dangerous yes" in terms of possibility. Thanks.