Skip to content

Commit

Permalink
fix: ~ScopedExpectation actually deletes its inner object
Browse files Browse the repository at this point in the history
  • Loading branch information
DNKpp committed Sep 21, 2024
1 parent c2979fd commit 046d0cf
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions include/mimic++/Expectation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -437,13 +437,10 @@ namespace mimicpp
};

public:
~ScopedExpectation() noexcept(false)
~ScopedExpectation() noexcept(false) // NOLINT(modernize-use-equals-default)
{
// we must call the dtor manually here, because std::unique_ptr's dtor mustn't throw.
if (auto* inner = m_Inner.release())
{
inner->~Concept();
}
::delete m_Inner.release();
}

template <typename Signature>
Expand Down

0 comments on commit 046d0cf

Please sign in to comment.