Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: use std::unique_ptr in base-object-inl.h #17079

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/base_object-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,8 @@ inline Environment* BaseObject::env() const {
template <typename Type>
inline void BaseObject::WeakCallback(
const v8::WeakCallbackInfo<Type>& data) {
Type* self = data.GetParameter();
std::unique_ptr<Type> self(data.GetParameter());
self->persistent().Reset();
delete self;
}


Expand Down
2 changes: 1 addition & 1 deletion src/env-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ inline Environment::~Environment() {
#if HAVE_INSPECTOR
// Destroy inspector agent before erasing the context. The inspector
// destructor depends on the context still being accessible.
inspector_agent_.reset(nullptr);
inspector_agent_.reset();
#endif

context()->SetAlignedPointerInEmbedderData(kContextEmbedderDataIndex,
Expand Down