mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2024-11-08 08:47:17 +01:00
Implement pointer stealing for the auto-deleter utility.
This commit is contained in:
parent
46d8d12c74
commit
e0fd5fa214
@ -253,6 +253,16 @@ public:
|
||||
m_Inst = nullptr;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Released the managed instance.
|
||||
*/
|
||||
T * Grab()
|
||||
{
|
||||
T * ptr = m_Inst;
|
||||
m_Inst = nullptr;
|
||||
return ptr;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------
|
||||
* Retrieve the managed instance.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user