From f841fc63ddc4808e301e30b60f666190c025f9a2 Mon Sep 17 00:00:00 2001 From: Franziska Hinkelmann Date: Thu, 16 Nov 2017 15:50:39 +0100 Subject: 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 Reviewed-By: Timothy Gu --- src/base_object-inl.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/base_object-inl.h') 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 inline void BaseObject::WeakCallback( const v8::WeakCallbackInfo& data) { - Type* self = data.GetParameter(); + std::unique_ptr self(data.GetParameter()); self->persistent().Reset(); - delete self; } -- cgit v1.2.3