summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/base_object-inl.h3
-rw-r--r--src/env-inl.h2
2 files changed, 2 insertions, 3 deletions
diff --git a/src/base_object-inl.h b/src/base_object-inl.h
index 74c1458b3d..900fc2b3ed 100644
--- a/src/base_object-inl.h
+++ b/src/base_object-inl.h
@@ -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;
}
diff --git a/src/env-inl.h b/src/env-inl.h
index f7a7559b3f..2c55e8cd94 100644
--- a/src/env-inl.h
+++ b/src/env-inl.h
@@ -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,