mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-04-29 16:39:38 +03:00
Correct conflict resolution for VScript leak fixes
This commit is contained in:
parent
a8283a8b11
commit
8576fb1d64
@ -1458,10 +1458,21 @@ SQInteger function_stub(HSQUIRRELVM vm)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
Assert(script_retval.m_type == pFunc->m_desc.m_ReturnType);
|
Assert(script_retval.m_type == pFunc->m_desc.m_ReturnType);
|
||||||
|
Assert( ( pFunc->m_desc.m_ReturnType != FIELD_VOID ) || !( pFunc->m_flags & SF_REFCOUNTED_RET ) );
|
||||||
|
|
||||||
if (pFunc->m_desc.m_ReturnType != FIELD_VOID)
|
if (pFunc->m_desc.m_ReturnType != FIELD_VOID)
|
||||||
{
|
{
|
||||||
PushVariant(vm, script_retval);
|
PushVariant(vm, script_retval);
|
||||||
|
|
||||||
|
if ( ( pFunc->m_flags & SF_REFCOUNTED_RET ) && script_retval.m_hScript )
|
||||||
|
{
|
||||||
|
Assert( script_retval.m_type == FIELD_HSCRIPT );
|
||||||
|
|
||||||
|
// Release the intermediary ref held from RegisterInstance
|
||||||
|
sq_release(vm, (HSQOBJECT*)script_retval.m_hScript);
|
||||||
|
delete (HSQOBJECT*)script_retval.m_hScript;
|
||||||
|
}
|
||||||
|
|
||||||
sq_retval = 1;
|
sq_retval = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1474,17 +1485,6 @@ SQInteger function_stub(HSQUIRRELVM vm)
|
|||||||
// everything else is stored inline, so there should be no memory to free
|
// everything else is stored inline, so there should be no memory to free
|
||||||
Assert(!(script_retval.m_flags & SV_FREE));
|
Assert(!(script_retval.m_flags & SV_FREE));
|
||||||
|
|
||||||
Assert( ( pFunc->m_desc.m_ReturnType != FIELD_VOID ) || !( pFunc->m_flags & SF_REFCOUNTED_RET ) );
|
|
||||||
|
|
||||||
if ( ( pFunc->m_flags & SF_REFCOUNTED_RET ) && script_retval.m_hScript )
|
|
||||||
{
|
|
||||||
Assert( script_retval.m_type == FIELD_HSCRIPT );
|
|
||||||
|
|
||||||
// Release the intermediary ref held from RegisterInstance
|
|
||||||
sq_release(vm, (HSQOBJECT*)script_retval.m_hScript);
|
|
||||||
delete (HSQOBJECT*)script_retval.m_hScript;
|
|
||||||
}
|
|
||||||
|
|
||||||
for ( int i = 0; i <= nLastHScriptIdx; ++i )
|
for ( int i = 0; i <= nLastHScriptIdx; ++i )
|
||||||
{
|
{
|
||||||
if ( pFunc->m_desc.m_Parameters[i] == FIELD_HSCRIPT )
|
if ( pFunc->m_desc.m_Parameters[i] == FIELD_HSCRIPT )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user