mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-07-02 23:17:12 +02:00
Implement pointer stealing for the auto-deleter utility.
This commit is contained in:
@ -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.
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user