Skip to content

Commit 07d1aed

Browse files
committed
fix: call destructor of weak pointer explicitly
Signed-off-by: Hosung Kim [email protected]
1 parent f104d6a commit 07d1aed

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

deps/node/src/node_crypto.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1383,7 +1383,8 @@ void SecureContext::SetSessionTimeout(const FunctionCallbackInfo<Value>& args) {
13831383
void SecureContext::Close(const FunctionCallbackInfo<Value>& args) {
13841384
SecureContext* sc;
13851385
ASSIGN_OR_RETURN_UNWRAP(&sc, args.Holder());
1386-
sc->Reset();
1386+
// sc->Reset(); // @lwnode
1387+
delete sc; // @lwnode
13871388
}
13881389

13891390

deps/node/src/node_file.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,8 @@ MaybeLocal<Promise> FileHandle::ClosePromise() {
368368
} else {
369369
close->Resolve();
370370
}
371+
372+
delete close->file_handle(); // @lwnode
371373
}};
372374
int ret = req->Dispatch(uv_fs_close, fd_, AfterClose);
373375
if (ret < 0) {

0 commit comments

Comments
 (0)