mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2026-10-28 23:47:09 +01:00
Implement pointer stealing for the auto-deleter utility.
This commit is contained in:
1 parent
46d8d12c74
commit
e0fd5fa214
1 file changed
+10
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user