diff --git a/ctl/unique_ptr.h b/ctl/unique_ptr.h index a1c83cbf4..b2853278e 100644 --- a/ctl/unique_ptr.h +++ b/ctl/unique_ptr.h @@ -69,7 +69,7 @@ struct unique_ptr inline void reset(nullptr_t = nullptr) noexcept { - if (d.first()) + if (*this) d.second()(d.first()); d.first() = nullptr; } @@ -79,7 +79,7 @@ struct unique_ptr /* requires is_convertible_v */ inline void reset(U* p2) { - if (d.first()) { + if (*this) { d.second()(d.first()); } d.first() = static_cast(p2);