0
如果我用C++代碼創建一個對象並在ActionScript代碼中返回它,我應該在返回它之前調用AS3_Release嗎?例如,我有功能的* .gg文件:當調用AS3_Release
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
變量?
感謝您的回答!你能解釋一下關於`result`變量嗎?這個對象將返回到ActionScript代碼,我們沒有方法釋放對象,因爲GC會自動處理所有引用。所以我應該希望GC最終清理這個對象? – 2011-02-01 20:28:34