Closed
Description
- Version: v10.11.0
- Platform: macOS
Hi, it looks like it's unsafe to call napi_queue_async_work
twice with the same napi_async_work
if the first napi_async_complete_callback
has yet to fire. I ran into this issue when porting my Native Addon from NAN to N-API. I can work around it easily, but it took a while to track down (all I was seeing was EXC_BAD_ACCESS
). Perhaps the documentation should be updated to reflect this? Here's one option (new text in bold):
This API requests that the previously allocated work be scheduled for execution. Do not call this API again if the work is not yet canceled or completed.
I haven't actually tested the cancel case.