wonderfl - build flash online

forked from: Castさんはなぜ…

※ 未解決に差し戻しました
forkして頂いたコードでご指摘を受けた通りでした。
浅い知識でレスポンスしてしまい、申し訳ありません。

私もprogressionのソースをcheckoutしてみました。
関連クラスを眺めてみましたが、これを綺麗にfixするのは骨が折れそうなので
progressionの作者さんにお任せしたいと思います。

jp.nium.core.collections.ExDisplayCollection._instances と、
jp.nium.display.ChildIndexer._indexers の二つのDictionaryの参照を
明示的に外すと、リークがかなり軽減される様です。

ExDisplayCollection._instances の方は弱参照Dictionaryですが
キーではなく値としてCastSpriteの参照を保持しているので、
解放したい場合は何らかの方法で参照を外す必要があるかと思います。
(あるいは、有効なDisplayObjectContainerにaddChildされるまで
_instancesに参照させない様にする等)

ChildIndexer._instances も弱参照Dictionaryで、
こちらはキーとしてCastSpriteの参照を保持していますが
_instancesがstaticメンバである為か、GCの対象にならない様です。

また、cast.parallelMode = false; で発生する例外に関しては、
実体がSerialListなのにPararellListに無理やりキャストした上でtoSerialList()している為に発生する様です。
_commandListの型チェックを入れれば解決するかと思います。
ex.)
if ( _parallelMode = value ) {
if( _commandList is SerialList ){
_commandList = SerialList( _commandList ).toParallelList();
}
} else {
if( _commandList is ParallelList){
_commandList = ParallelList( _commandList ).toSerialList(

hacker_y48qdmdh hacker_y48qd..

add to favorites

Embed

Code Fullscreen

Favorite by

Tags

sectKeywords

Forked

ページの先頭へ戻る