flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmcl...@apache.org
Subject git commit: [flex-sdk] [refs/heads/develop] - FLEX-33593 Remove mouse event listeners when removing items.
Date Thu, 20 Jun 2013 13:08:07 GMT
Updated Branches:
  refs/heads/develop c72ef2dce -> 34c9dfbdc


FLEX-33593 Remove mouse event listeners when removing items.


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/34c9dfbd
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/34c9dfbd
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/34c9dfbd

Branch: refs/heads/develop
Commit: 34c9dfbdcaae9a55e077f48952ed8e51b8e5e635
Parents: c72ef2d
Author: Justin Mclean <jmclean@apache.org>
Authored: Thu Jun 20 23:04:38 2013 +1000
Committer: Justin Mclean <jmclean@apache.org>
Committed: Thu Jun 20 23:04:38 2013 +1000

----------------------------------------------------------------------
 frameworks/projects/mx/src/mx/controls/MenuBar.as | 11 +++++++++++
 1 file changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/34c9dfbd/frameworks/projects/mx/src/mx/controls/MenuBar.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/mx/src/mx/controls/MenuBar.as b/frameworks/projects/mx/src/mx/controls/MenuBar.as
index 07ddb6e..c4158b2 100644
--- a/frameworks/projects/mx/src/mx/controls/MenuBar.as
+++ b/frameworks/projects/mx/src/mx/controls/MenuBar.as
@@ -1878,6 +1878,11 @@ public class MenuBar extends UIComponent implements IFocusManagerComponent
 
         if (item)
         {
+			item.removeEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
+			item.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
+			item.removeEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
+			item.removeEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
+			
             removeChild(DisplayObject(item));
             menuBarItems.splice(index, 1);
             invalidateSize();
@@ -1897,6 +1902,12 @@ public class MenuBar extends UIComponent implements IFocusManagerComponent
         while (menuBarItems.length > 0)
         {
             var item:IMenuBarItemRenderer = menuBarItems[0];
+			
+			item.removeEventListener(MouseEvent.MOUSE_OVER, mouseOverHandler);
+			item.removeEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
+			item.removeEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
+			item.removeEventListener(MouseEvent.MOUSE_OUT, mouseOutHandler);
+
             removeChild(DisplayObject(item));
             menuBarItems.splice(0, 1);
         }


Mime
View raw message