diff options
author | Franziska Hinkelmann <franziska.hinkelmann@gmail.com> | 2017-11-16 15:50:39 +0100 |
---|---|---|
committer | Franziska Hinkelmann <franziska.hinkelmann@gmail.com> | 2017-11-19 09:20:26 +0100 |
commit | f841fc63ddc4808e301e30b60f666190c025f9a2 (patch) | |
tree | fb17aec77d1a4565751b84de4fa74b52d73ce0e7 /src/base_object-inl.h | |
parent | ce6c7f5b01a9faf5b4c6561944e89ba8d42b68de (diff) | |
download | android-node-v8-f841fc63ddc4808e301e30b60f666190c025f9a2.tar.gz android-node-v8-f841fc63ddc4808e301e30b60f666190c025f9a2.tar.bz2 android-node-v8-f841fc63ddc4808e301e30b60f666190c025f9a2.zip |
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>
Diffstat (limited to 'src/base_object-inl.h')
-rw-r--r-- | src/base_object-inl.h | 3 |
1 files changed, 1 insertions, 2 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; } |