如果我在 C++ 代码中创建一个对象并在 ActionScript 代码中返回它,我应该在返回它之前调用 AS3_Release 吗?例如,我在 *.gg 文件中有函数:
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;
}
我应该调用AS3_Release
和objDestByteArray
变量result
吗?