mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-22 02:26:11 +00:00
AK: Decorate AK::OwnPtr::leak_ptr() with [[nodiscard]]
We should always leak to an observed variable, otherwise it's an actual leak. This is similar to AK::RefPtr::leak_ref() which is also marked as [[nodiscard]].
This commit is contained in:
parent
00fe4c7bcb
commit
fa625a2690
|
@ -137,7 +137,7 @@ public:
|
|||
|
||||
bool operator!() const { return !m_ptr; }
|
||||
|
||||
T* leak_ptr()
|
||||
[[nodiscard]] T* leak_ptr()
|
||||
{
|
||||
T* leaked_ptr = m_ptr;
|
||||
m_ptr = nullptr;
|
||||
|
|
Loading…
Reference in a new issue