Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
squash! src: add typedef for CleanupHookCallback callback
Update AddCleanupHook and RemoveCleanupHook in env-inl.h.
  • Loading branch information
danbev committed Dec 8, 2020
commit 0c833d469ef314ae4915f6a7feed8b7bde46e9b8
4 changes: 2 additions & 2 deletions src/env-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -1024,15 +1024,15 @@ inline void Environment::SetInstanceMethod(v8::Local<v8::FunctionTemplate> that,
t->SetClassName(name_string);
}

void Environment::AddCleanupHook(void (*fn)(void*), void* arg) {
void Environment::AddCleanupHook(CleanupCallback fn, void* arg) {
auto insertion_info = cleanup_hooks_.emplace(CleanupHookCallback {
fn, arg, cleanup_hook_counter_++
});
// Make sure there was no existing element with these values.
CHECK_EQ(insertion_info.second, true);
}

void Environment::RemoveCleanupHook(void (*fn)(void*), void* arg) {
void Environment::RemoveCleanupHook(CleanupCallback fn, void* arg) {
CleanupHookCallback search { fn, arg, 0 };
cleanup_hooks_.erase(search);
}
Expand Down