Skip to content

Commit

Permalink
src: use BaseObjectPtr in StreamReq::Dispose
Browse files Browse the repository at this point in the history
  • Loading branch information
jasnell committed May 6, 2020
1 parent 120d707 commit 1dc006e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/stream_base-inl.h
Expand Up @@ -4,6 +4,7 @@
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#include "async_wrap-inl.h"
#include "base_object-inl.h"
#include "node.h"
#include "stream_base.h"
#include "v8.h"
Expand Down Expand Up @@ -31,9 +32,10 @@ StreamReq* StreamReq::FromObject(v8::Local<v8::Object> req_wrap_obj) {
}

void StreamReq::Dispose() {
std::unique_ptr<StreamReq> ptr(this);
BaseObjectPtr<AsyncWrap> destroy_me{GetAsyncWrap()};
object()->SetAlignedPointerInInternalField(
StreamReq::kStreamReqField, nullptr);
destroy_me->Detach();
}

v8::Local<v8::Object> StreamReq::object() {
Expand Down

0 comments on commit 1dc006e

Please sign in to comment.