OBSE functions and local strings

Post » Sat Aug 13, 2011 1:18 pm

I know you have to clean up local strings that you create in a OBSE function. However it is not clear to me if this is also needed in case the local string is used as a return value? See the following code:

ScriptName qesGetSizeStringstring_var namearray_var arrshort sizestring_var sizeStrBegin Function {name,arr}	Let size := ar_Size arr	if size == 0		Let sizeStr := sv_Construct "%z", name	else		Let sizeStr := sv_Construct "%z (%.0f items)", name, size	endif	SetFunctionValue sizeStr	sv_Destruct sizeStrEnd


Is that last sv_Destruct required? Or harmful?
User avatar
Kelly Osbourne Kelly
 
Posts: 3426
Joined: Sun Nov 05, 2006 6:56 pm

Return to IV - Oblivion