mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-02-21 20:27:13 +01:00
Make a few midifications to StackStrF.
This commit is contained in:
parent
02377fbd46
commit
58acfb9857
@ -1580,7 +1580,7 @@ struct StackStrF
|
||||
/// Base constructor.
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
StackStrF(HSQUIRRELVM vm, SQInteger idx)
|
||||
: mPtr(nullptr)
|
||||
: mPtr(_SC(""))
|
||||
, mLen(SQ_ERROR)
|
||||
, mRes(SQ_OK)
|
||||
, mObj()
|
||||
@ -1605,7 +1605,7 @@ struct StackStrF
|
||||
, mVM(o.mVM)
|
||||
, mIdx(o.mIdx)
|
||||
{
|
||||
o.mPtr = nullptr;
|
||||
o.mPtr = _SC("");
|
||||
o.mLen = 0;
|
||||
o.mRes = SQ_OK;
|
||||
o.mVM = nullptr;
|
||||
@ -1618,9 +1618,9 @@ struct StackStrF
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
~StackStrF()
|
||||
{
|
||||
if (mVM && !sq_isnull(mObj))
|
||||
if (!sq_isnull(mObj))
|
||||
{
|
||||
sq_release(mVM, &mObj);
|
||||
sq_release(mVM ? mVM : DefaultVM::Get(), &mObj);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1634,6 +1634,23 @@ struct StackStrF
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
StackStrF & operator = (StackStrF && o) = delete;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/// Release any object references.
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
void Release()
|
||||
{
|
||||
if (!sq_isnull(mObj))
|
||||
{
|
||||
sq_release(mVM ? mVM : DefaultVM::Get(), &mObj);
|
||||
}
|
||||
mPtr = _SC("");
|
||||
mLen = 0;
|
||||
mRes = SQ_OK;
|
||||
mVM = nullptr;
|
||||
mIdx = -1;
|
||||
sq_resetobject(&mObj);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/// Actual implementation.
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
Loading…
x
Reference in New Issue
Block a user