Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9024436

Browse filesBrowse files
addaleaxMylesBorins
authored andcommitted
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: #35481 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 1cd1d01 commit 9024436
Copy full SHA for 9024436

File tree

Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed
Open diff view settings
Collapse file

‎src/node_crypto.h‎

Copy file name to clipboardExpand all lines: src/node_crypto.h
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,9 @@ class NativeKeyObject : public BaseObject {
518518
v8::Local<v8::Object> wrap,
519519
const std::shared_ptr<KeyObjectData>& handle_data)
520520
: BaseObject(env, wrap),
521-
handle_data_(handle_data) {}
521+
handle_data_(handle_data) {
522+
MakeWeak();
523+
}
522524

523525
std::shared_ptr<KeyObjectData> handle_data_;
524526
};

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.