| commit | 543eaac415bfba59e648a3da8be5c4f964f9bc6e | [log] [tgz] |
|---|---|---|
| author | Scott Wolchok <swolchok@fb.com> | Mon May 02 16:26:22 2022 -0700 |
| committer | PyTorch MergeBot <pytorchmergebot@users.noreply.github.com> | Tue May 03 16:55:33 2022 +0000 |
| tree | fff4b5f01885bd7043873335a8867db9e69c162b | |
| parent | 6b6c63ce5e0b54eb92cdd88f3bb87efc7adeaf9c [diff] |
[PyTorch] Remove dead store in intrusive_ptr dtor There is no need to null out `target_` in the destructor. Differential Revision: [D36083158](https://our.internmc.facebook.com/intern/diff/D36083158/) Pull Request resolved: https://github.com/pytorch/pytorch/pull/76701 Approved by: https://github.com/ezyang
diff --git a/c10/util/intrusive_ptr.h b/c10/util/intrusive_ptr.h index 4a3534b..ef256b4 100644 --- a/c10/util/intrusive_ptr.h +++ b/c10/util/intrusive_ptr.h
@@ -293,7 +293,6 @@ delete target_; } } - target_ = NullType::singleton(); } // raw pointer constructors are not public because we shouldn't make @@ -417,6 +416,7 @@ void reset() noexcept { reset_(); + target_ = NullType::singleton(); } void swap(intrusive_ptr& rhs) noexcept {