Commit aa1a4f3 1 parent b58fe52 commit aa1a4f3 Copy full SHA for aa1a4f3
File tree 2 files changed +16
-6
lines changed
2 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ static void RunAsyncCleanupHook(void* arg) {
145
145
info->fun (info->arg , FinishAsyncCleanupHook, info);
146
146
}
147
147
148
- AsyncCleanupHookHandle AddEnvironmentCleanupHook (
148
+ ACHHandle* AddEnvironmentCleanupHookRaw (
149
149
Isolate* isolate,
150
150
AsyncCleanupHook fun,
151
151
void * arg) {
@@ -157,11 +157,11 @@ AsyncCleanupHookHandle AddEnvironmentCleanupHook(
157
157
info->arg = arg;
158
158
info->self = info;
159
159
env->AddCleanupHook (RunAsyncCleanupHook, info.get ());
160
- return AsyncCleanupHookHandle ( new ACHHandle { info }) ;
160
+ return new ACHHandle { info };
161
161
}
162
162
163
- void RemoveEnvironmentCleanupHook (
164
- AsyncCleanupHookHandle handle) {
163
+ void RemoveEnvironmentCleanupHookRaw (
164
+ ACHHandle* handle) {
165
165
if (handle->info ->started ) return ;
166
166
handle->info ->self .reset ();
167
167
handle->info ->env ->RemoveCleanupHook (RunAsyncCleanupHook, handle->info .get ());
Original file line number Diff line number Diff line change @@ -925,12 +925,22 @@ struct ACHHandle;
925
925
struct NODE_EXTERN DeleteACHHandle { void operator ()(ACHHandle*) const ; };
926
926
typedef std::unique_ptr<ACHHandle, DeleteACHHandle> AsyncCleanupHookHandle;
927
927
928
- NODE_EXTERN AsyncCleanupHookHandle AddEnvironmentCleanupHook (
928
+ NODE_EXTERN ACHHandle* AddEnvironmentCleanupHookRaw (
929
929
v8::Isolate* isolate,
930
930
void (*fun)(void * arg, void (*cb)(void *), void* cbarg),
931
931
void* arg);
932
+ inline AsyncCleanupHookHandle AddEnvironmentCleanupHook (
933
+ v8::Isolate* isolate,
934
+ void (*fun)(void * arg, void (*cb)(void *), void* cbarg),
935
+ void* arg) {
936
+ return AsyncCleanupHookHandle (AddEnvironmentCleanupHookRaw (isolate, fun,
937
+ arg));
938
+ }
932
939
933
- NODE_EXTERN void RemoveEnvironmentCleanupHook (AsyncCleanupHookHandle holder);
940
+ NODE_EXTERN void RemoveEnvironmentCleanupHookRaw (ACHHandle* holder);
941
+ inline void RemoveEnvironmentCleanupHook (AsyncCleanupHookHandle holder) {
942
+ RemoveEnvironmentCleanupHookRaw (holder.get ());
943
+ }
934
944
935
945
/* Returns the id of the current execution context. If the return value is
936
946
* zero then no execution has been set. This will happen if the user handles
You can’t perform that action at this time.
0 commit comments