diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2018-02-21 15:24:18 +0100 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2018-02-21 15:24:18 +0100 |
commit | 992703f2b50f6b3483e9b930737d177b9e01256d (patch) | |
tree | 7d9b2752b6021d7653d426bbebdc80a437624a47 /src/inspector_agent.h | |
parent | e53275d819fb21d4bb15a27a714f134551233cf9 (diff) | |
download | android-node-v8-992703f2b50f6b3483e9b930737d177b9e01256d.tar.gz android-node-v8-992703f2b50f6b3483e9b930737d177b9e01256d.tar.bz2 android-node-v8-992703f2b50f6b3483e9b930737d177b9e01256d.zip |
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/inspector_agent.h')
-rw-r--r-- | src/inspector_agent.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/inspector_agent.h b/src/inspector_agent.h index 0555f5e18c..56fb407930 100644 --- a/src/inspector_agent.h +++ b/src/inspector_agent.h @@ -97,7 +97,7 @@ class Agent { private: void ToggleAsyncHook(v8::Isolate* isolate, - const v8::Persistent<v8::Function>& fn); + const Persistent<v8::Function>& fn); node::Environment* parent_env_; std::unique_ptr<NodeInspectorClient> client_; @@ -109,8 +109,8 @@ class Agent { bool pending_enable_async_hook_; bool pending_disable_async_hook_; - v8::Persistent<v8::Function> enable_async_hook_function_; - v8::Persistent<v8::Function> disable_async_hook_function_; + Persistent<v8::Function> enable_async_hook_function_; + Persistent<v8::Function> disable_async_hook_function_; }; } // namespace inspector |