FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

crypto: fix KeyObject garbage collection · nodejs/node@a01154e · GitHub

/ node Public

Commit a01154e

Browse files
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

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎src/node_crypto.h‎

Lines 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)

Back | FazBrowse Home | New Git URL