Commit 2347de8 1 parent 4db9854 commit 2347de8 Copy full SHA for 2347de8
File tree 2 files changed +14
-6
lines changed
2 files changed +14
-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,20 @@ 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 (v8::Isolate* isolate,
933
+ void (*fun)(void * arg, void (*cb)(void *), void* cbarg),
934
+ void* arg) {
935
+ return AsyncCleanupHookHandle (AddEnvironmentCleanupHookRaw (isolate, fun, arg));
936
+ }
932
937
933
- NODE_EXTERN void RemoveEnvironmentCleanupHook (AsyncCleanupHookHandle holder);
938
+ NODE_EXTERN void RemoveEnvironmentCleanupHookRaw (ACHHandle* holder);
939
+ inline void RemoveEnvironmentCleanupHook (AsyncCleanupHookHandle holder) {
940
+ RemoveEnvironmentCleanupHookRaw (holder.get ());
941
+ }
934
942
935
943
/* Returns the id of the current execution context. If the return value is
936
944
* 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