diff options
author | Trevor Norris <trev.norris@gmail.com> | 2016-11-22 22:35:10 -0700 |
---|---|---|
committer | Trevor Norris <trev.norris@gmail.com> | 2016-12-01 16:49:17 -0700 |
commit | b49b496a92118bf786176bc3c763a292b9bdff5d (patch) | |
tree | 0894d58240a8b35f2f6a65e08eb9e97f52ba0744 /src/async-wrap.h | |
parent | cf5f4b85f5ef7befa592d83b69be646f7efb236a (diff) | |
download | android-node-v8-b49b496a92118bf786176bc3c763a292b9bdff5d.tar.gz android-node-v8-b49b496a92118bf786176bc3c763a292b9bdff5d.tar.bz2 android-node-v8-b49b496a92118bf786176bc3c763a292b9bdff5d.zip |
async_wrap: call destroy() callback in uv_idle_t
Calling JS during GC is a no-no. So intead create a queue of all ids
that need to have their destroy() callback called and call them later.
Removed checking destroy() in test-async-wrap-uid because destroy() can
be called after the 'exit' callback.
Missing a reliable test to reproduce the issue that caused the
FATAL_ERROR.
PR-URL: https://github.com/nodejs/node/pull/9753
Fixes: https://github.com/nodejs/node/issues/8216
Fixes: https://github.com/nodejs/node/issues/9465
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'src/async-wrap.h')
-rw-r--r-- | src/async-wrap.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/async-wrap.h b/src/async-wrap.h index 5ffd67dba9..d01c6ce9f9 100644 --- a/src/async-wrap.h +++ b/src/async-wrap.h @@ -4,6 +4,7 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS #include "base-object.h" +#include "uv.h" #include "v8.h" #include <stdint.h> @@ -60,6 +61,8 @@ class AsyncWrap : public BaseObject { v8::Local<v8::Value> unused, v8::Local<v8::Context> context); + static void DestroyIdsCb(uv_idle_t* handle); + inline ProviderType provider_type() const; inline int64_t get_uid() const; |