有誰知道是否可以將垃圾回收應用到AS3中新的StageVideo組件?我嘗試過沒有成功!代碼如下:如何觸發垃圾收集?
if (this._stageVideo == null)
{
this._stageVideo = stage.stageVideos[0];
this._stageVideo.addEventListener(StageVideoEvent.RENDER_STATE, stageVideoStateChange);
}
嘗試在GC:
this._stageVideo = null;
this._stageVideo.removeEventListener(StageVideoEvent.RENDER_STATE, stageVideoStateChange);
有沒有這樣的事情「應用垃圾回收」,您只能通過刪除所有事件偵聽器和對象引用來準備要垃圾收集的對象。因此,如果您要顯示一些代碼,那就太好了 –