Commit 2cf26351 authored by Franziska Hinkelmann's avatar Franziska Hinkelmann Committed by Rod Vagg
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.

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


Reviewed-By: default avatarAnna Henningsen <anna@addaleax.net>
parent 2148b192
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