libluna: Add OwnedPtr::leak()

This commit is contained in:
apio 2023-09-27 18:50:56 +02:00
parent 9a9c7e577a
commit 54afd7c2b0
Signed by: apio
GPG Key ID: B8A7D06E42258954

View File

@ -49,6 +49,13 @@ template <typename T> class OwnedPtr
return m_ptr;
}
T* leak()
{
T* ptr = m_ptr;
m_ptr = nullptr;
return ptr;
}
T* operator->() const
{
return m_ptr;