Home > しらべる > PureMVCのメモリ管理

PureMVCのメモリ管理

  • Posted by: memorycraft
  • 2008年6月27日 03:07
  • しらべる

PureMVCを使用したFlexなどのアプリで、メモリの開放や初期化などで、

Mediator::onRegister
Mediator::onRemove
(Proxyも同様)

が便利なことに気づいた~(いまさら)

override public function onRegister():void{
  //イベントリスナの登録
  widget.addEventListener(Widget.OPEN, onOpen);
  widget.addEventListener(Widget.SAVE, onSave);
}
override public function onRemove():void{
  //イベントリスナの削除
  widget.removeEventListener(Widget.OPEN, onOpen);
  widget.removeEventListener(Widget.SAVE, onSave);
}

こうすれば、
registerMediator時にリスナ登録、
removeMediator時にリスナ開放
が自動的に行なわれる。

気づくのおそいー。

Trackbacks:0

TrackBack URL for this entry
http://www.memorycraft.jp/mt-tb.cgi/38
Listed below are links to weblogs that reference
PureMVCのメモリ管理 from メモリークラフト

Comments:0

Comment Form

Home > しらべる > PureMVCのメモリ管理

ページの先頭へ戻る