Skip to content

Commit cf47698

Browse files
jasnellcodebytere
authored andcommitted
1 parent 5ff3192 commit cf47698

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/stream_base-inl.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
55

66
#include "async_wrap-inl.h"
7+
#include "base_object-inl.h"
78
#include "node.h"
89
#include "stream_base.h"
910
#include "v8.h"
@@ -31,9 +32,10 @@ StreamReq* StreamReq::FromObject(v8::Local<v8::Object> req_wrap_obj) {
3132
}
3233

3334
void StreamReq::Dispose() {
34-
std::unique_ptr<StreamReq> ptr(this);
35+
BaseObjectPtr<AsyncWrap> destroy_me{GetAsyncWrap()};
3536
object()->SetAlignedPointerInInternalField(
3637
StreamReq::kStreamReqField, nullptr);
38+
destroy_me->Detach();
3739
}
3840

3941
v8::Local<v8::Object> StreamReq::object() {

0 commit comments

Comments
 (0)