Commit 24e824ad authored by Franziska Hinkelmann's avatar Franziska Hinkelmann
Browse files

src: use unique_ptr for scheduled delayed tasks

Use std::unique_ptr for delayed tasks in the scheduled
delayed tasks vector. This makes it clear that the vector
has ownership of the delayed tasks and is responsible for
deleting them.

Use a custom deleter for the pointers because libuv
needs to close the handle and then delete the data. Provide
the handle when creating the pointer instead of invoking the
special delete action everytime an element is removed from the vector.

PR-URL: https://github.com/nodejs/node/pull/17083


Reviewed-By: default avatarAnna Henningsen <anna@addaleax.net>
parent f841fc63
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment