2006年12月03日

download the fixed mm_menu.js, a built-in pop-up menu JavaScript of Dreamweaver & Fireworks

mm_menu.js is a JavaScript code for built-in pop-up menu of Dreamweaver and Fireworks. And it is a opensource program.

/**
* mm_menu 20MAR2002 Version 6.0
* Andy Finnell, March 2002
* Copyright (c) 2000-2002 Macromedia, Inc.
*
* based on menu.js
* by gary smith, July 1997
* Copyright (c) 1997-1999 Netscape Communications Corp.
*
* Netscape grants you a royalty free license to use or modify this
* software provided that this copyright notice appears on all copies.
* This software is provided "AS IS," without a warranty of any kind.
*/

If you open this menu with Internet Explorer, you might notice that IE continually consumes your PC's memory, and finally, there will be no response.
(If you close the IE, all the memory will be backed to the Windows OS.)

After spending some hours to examine the mm_menu.js, finally, the memory leak problem was soleved!

reference:
Understanding and Solving Internet Explorer Leak Patterns

The problem was just a one line:

l.Menu.menuItemLayers[l.Menu.menuItemLayers.length] = l;

How to solve?

Change:

Line 324:
//l.Menu.menuItemLayers[l.Menu.menuItemLayers.length] = l;
l.Menu.menuItemLayers[l.Menu.menuItemLayers.length] = “menuItem” + menuCount;

and,

Line 650:
//var itemLayer = theLayer.Menu.menuItemLayers[j];
var itemLayer = FIND(theLayer.Menu.menuItemLayers[j]);

If you'd like to download, get it from here:
mm_menu_memoryleak_fixed.zip

If you want to solve a problem of mm_menu.js + iFrame, you can use this: (However, you might have to change some code..)
mm_menu_memleakfixed_and_sim.zip

I tested with Drip memory leak tool.

Original mm_menu.js:
leaked.PNG

Fixed mm_menu.js:
fixed.PNG



posted by SDozono at 13:37| 東京 ☀| Comment(0) | TrackBack(0) | JavaScript | このブログの読者になる | 更新情報をチェックする
この記事へのコメント
コメントを書く
お名前:

メールアドレス: [必須入力]

ホームページアドレス:

コメント: [必須入力]

認証コード: [必須入力]


※画像の中の文字を半角で入力してください。

この記事へのトラックバック
WebとCTI、VoIP技術の高みを目指して - 技術者の24時間
×

この広告は180日以上新しい記事の投稿がないブログに表示されております。