If I create an object in C++ code and return it in ActionScript code should I call AS3_Release before returning it? For example, I have the function in the *.gg file:
public function makeThumbnail(...): Object
{
AS3_Val objDestByteArray = AS3_New(ByteArray_class, no_params);
int intDestWidth;
int intDestHeight;
// ... make some calculations and set results as object properties
AS3_Val result = AS3_Object("width:IntType, height:IntType, data:AS3ValType", intDestWidth, intDestHeight, objDestByteArray);
// Do I need to call this?
//AS3_Release(objDestByteArray);
//AS3_Release(result);
return result;
}
Should I call AS3_Release
for objDestByteArray
and result
variables?