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 a01154e

Browse filesBrowse files
addaleaxdanielleadams
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 fcbdb06 commit a01154e
Copy full SHA for a01154e

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
@@ -519,7 +519,9 @@ class NativeKeyObject : public BaseObject {
519519
v8::Local<v8::Object> wrap,
520520
const std::shared_ptr<KeyObjectData>& handle_data)
521521
: BaseObject(env, wrap),
522-
handle_data_(handle_data) {}
522+
handle_data_(handle_data) {
523+
MakeWeak();
524+
}
523525

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

0 commit comments

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