mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
crypto: fix KeyObject garbage collection
These objects don’t hold any resources on the event loop, so they should be weak objects that can be garbage collected when nothing refers to them anymore. PR-URL: https://github.com/nodejs/node/pull/35481 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
1 parent
1cd1d0159d
commit
90244362cc
1 file changed
+3
-1
+3
-1
@@ -518,7 +518,9 @@ class NativeKeyObject : public BaseObject {
|
||||
v8::Local<v8::Object> wrap,
|
||||
const std::shared_ptr<KeyObjectData>& handle_data)
|
||||
: BaseObject(env, wrap),
|
||||
handle_data_(handle_data) {}
|
||||
handle_data_(handle_data) {
|
||||
MakeWeak();
|
||||
}
|
||||
|
||||
std::shared_ptr<KeyObjectData> handle_data_;
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user