AS3マジでメモリの開放がめんどくさい。
外部swf入れ替え系はまぢでうっとおしいな。
なんか手っ取り早い方法はないんか。
作れってか?
あーあーあーあー。
AS3マジでメモリの開放がめんどくさい。
外部swf入れ替え系はまぢでうっとおしいな。
なんか手っ取り早い方法はないんか。
作れってか?
あーあーあーあー。
We use cookies to improve your experience on our site. By using our site, you consent to cookies.
Manage your cookie preferences below:
Essential cookies enable basic functions and are necessary for the proper function of the website.
These cookies are needed for adding comments on this website.
Google reCAPTCHA helps protect websites from spam and abuse by verifying user interactions through challenges.
Google Tag Manager simplifies the management of marketing tags on your website without code changes.
Statistics cookies collect information anonymously. This information helps us understand how visitors use our website.
Google Analytics is a powerful tool that tracks and analyzes website traffic for informed marketing decisions.
Service URL: policies.google.com (opens in a new window)
Marketing cookies are used to follow visitors to websites. The intention is to show ads that are relevant and engaging to the individual user.
A video-sharing platform for users to upload, view, and share videos across various genres and topics.
Service URL: www.youtube.com (opens in a new window)
You can find more information in our Cookie Policy and Privacy policy.
「ぐーーーー」への6件の返信
メモ。
proxyからもきちんと削除すること。
稼働中のTweenerもきれいに掃除すること。(これは掃除しなくても完了したら自動的にGCに入る?)
とりあえず全部のClassでremove処理を実行するようにする。タイムライン配置のDisplayObject系は?
メモリ管理ってウザイですよね・・・
個人的にはAS3はDisplayObjectを消し忘れて、parent参照が残っててparent.parent.parent.parent…というで、芋蔓式に全部GCされない現象が怖いです。
あ、parentもいつもnullにしてから削除してます??parentは特に気にしてなかったんだけど、残る原因になるのかしら??(parentって参照ってよりもgetterっぽいイメージなんだけど違うのかしら?)
えとparentをnullするというか、removeChildしわすれたMCの参照がどっかに1つ残ってるだけで、DisplayList経由で親まで全てGCされなくなる現象な感じです。
killするときに、
if(parent)
parent.removeChild(this)
みたいにするように心がけてます。
あーそうですね。それ深い構造のやつ(正に今やってる)だとすげー面倒ですよね・・。
出来るだけaddChildする部分をviewに相当する部分にまとめて一元管理できるようにしてますけど、動的にdisplayObjectを生成するタイプだと管理が大変すぎる・・。(配列で管理しててもその配列に参照が残ってんじゃんみたいな・・一個一個spliceしてnullみたいな・・いやだーー汗)
ちなみにTweenerの除去ってどーしてます?気持ち的にはremoveAllTweensしてしまいたいですが、それすると親もクリアされちゃうから一つ一つ削除とかしてるんですが、もうこれが動きが多いやつだとすげえ面倒で死にそうです。そのaplicationDomain(SWF)の中のTweenerを統合して管理するようなクラスを作って破棄すべきなのか悩みます。(ただ削除のタイミングによってはうまくいかないような気もしつつ・・)
今removedFromStageに紐付け手自殺するように色々試しているのですが、どーも開放されません(汗
外部swf入れ替え系コンテンツにはas3は向かないんじゃないかと最近良く思います・・・。
あ、そういやblogに書かれていたDictionaryでGC漏れを監視するやつ、今すごく欲しいですw