mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2025-03-03 17:25:27 +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
|
||||
{
|
||||
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)
|
||||
{
|
||||
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;
|
||||
}
|
||||
else
|
||||
@ -1474,17 +1485,6 @@ SQInteger function_stub(HSQUIRRELVM vm)
|
||||
// everything else is stored inline, so there should be no memory to 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 )
|
||||
{
|
||||
if ( pFunc->m_desc.m_Parameters[i] == FIELD_HSCRIPT )
|
||||
|
Loading…
x
Reference in New Issue
Block a user