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

Drive-by fix: delete superflouos nullptr in ptr.reset().

PR-URL: https://github.com/nodejs/node/pull/17079
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
This commit is contained in:
Franziska Hinkelmann committed 2017-11-19 09:20:26 +01:00
1 parent ce6c7f5b01
commit f841fc63dd
2 files changed
+2 -3

No files matched your search

+1 -2
View File
@@ -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;
}
+1 -1
View File
@@ -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,