mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 20:47:45 +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
1 changed files with 1 additions and 1 deletions
|
@ -137,7 +137,7 @@ public:
|
||||||
|
|
||||||
bool operator!() const { return !m_ptr; }
|
bool operator!() const { return !m_ptr; }
|
||||||
|
|
||||||
T* leak_ptr()
|
[[nodiscard]] T* leak_ptr()
|
||||||
{
|
{
|
||||||
T* leaked_ptr = m_ptr;
|
T* leaked_ptr = m_ptr;
|
||||||
m_ptr = nullptr;
|
m_ptr = nullptr;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue