mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-01-19 12:07:13 +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;
|
m_Inst = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------------------------------
|
||||||
|
* Released the managed instance.
|
||||||
|
*/
|
||||||
|
T * Grab()
|
||||||
|
{
|
||||||
|
T * ptr = m_Inst;
|
||||||
|
m_Inst = nullptr;
|
||||||
|
return ptr;
|
||||||
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------
|
/* --------------------------------------------------------------------------------------------
|
||||||
* Retrieve the managed instance.
|
* Retrieve the managed instance.
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user