diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-07-15 23:17:45 +0300 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2019-08-01 01:51:43 +0300 |
commit | 5207dec0175de92116262e8382d6ac57def3a203 (patch) | |
tree | e90e855f7a8a228e00fe0d49fb311b319de74c3d /src/async_wrap.h | |
parent | 61f3a5c60ad78506e9e0caae061a04ccab878ca1 (diff) |
src: allow generic C++ callables in SetImmediate()
Modify the native `SetImmediate()` functions to take generic C++
callables as arguments. This makes passing arguments to the callback
easier, and in particular, it allows passing `std::unique_ptr`s
directly, which in turn makes sure that the data they point to is
deleted if the `Environment` is torn down before the callback can run.
PR-URL: https://github.com/nodejs/node/pull/28704
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/async_wrap.h')
-rw-r--r-- | src/async_wrap.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/async_wrap.h b/src/async_wrap.h index 546f5130e01..0a29264189a 100644 --- a/src/async_wrap.h +++ b/src/async_wrap.h @@ -154,7 +154,7 @@ class AsyncWrap : public BaseObject { static void EmitTraceEventAfter(ProviderType type, double async_id); void EmitTraceEventDestroy(); - static void DestroyAsyncIdsCallback(Environment* env, void* data); + static void DestroyAsyncIdsCallback(Environment* env); inline ProviderType provider_type() const; inline ProviderType set_provider_type(ProviderType provider); |