Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2018-02-21 17:24:18 +0300
committerBen Noordhuis <info@bnoordhuis.nl>2018-02-21 17:24:18 +0300
commit992703f2b50f6b3483e9b930737d177b9e01256d (patch)
tree7d9b2752b6021d7653d426bbebdc80a437624a47 /src/async_wrap.cc
parente53275d819fb21d4bb15a27a714f134551233cf9 (diff)
src: prevent persistent handle resource leaks
Replace v8::Persistent with node::Persistent, a specialization that resets the persistent handle on destruction. Prevents accidental resource leaks when forgetting to call .Reset() manually. I'm fairly confident this commit fixes a number of resource leaks that have gone undiagnosed so far. PR-URL: https://github.com/nodejs/node/pull/18656 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Diffstat (limited to 'src/async_wrap.cc')
-rw-r--r--src/async_wrap.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/async_wrap.cc b/src/async_wrap.cc
index 7fa5f0ade9a..c23535f094d 100644
--- a/src/async_wrap.cc
+++ b/src/async_wrap.cc
@@ -409,8 +409,8 @@ static void DisablePromiseHook(const FunctionCallbackInfo<Value>& args) {
class DestroyParam {
public:
double asyncId;
- v8::Persistent<Object> target;
- v8::Persistent<Object> propBag;
+ Persistent<Object> target;
+ Persistent<Object> propBag;
};