Author: andrei_exadel
Date: 2009-03-27 11:37:11 -0400 (Fri, 27 Mar 2009)
New Revision: 13265
Modified:
trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
Log:
Fix memory leaks
Modified:
trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
===================================================================
---
trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2009-03-27
15:32:20 UTC (rev 13264)
+++
trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2009-03-27
15:37:11 UTC (rev 13265)
@@ -61,8 +61,40 @@
}
this.combobox.component = this;
this.initHandlers();
+ this["rich:destructor"] = "destroy";
},
+ destroy: function () {
+
+ Event.stopObserving(this.combobox, 'rich:onselect');
+
+ Event.stopObserving(this.button, 'click');
+ Event.stopObserving(this.button, 'mouseup');
+ Event.stopObserving(this.button, 'mousedown');
+ Event.stopObserving(this.button, 'mouseover');
+ Event.stopObserving(this.button, 'mouseout');
+
+ Event.stopObserving(this.field, 'keydown');
+ Event.stopObserving(this.field, 'blur');
+ Event.stopObserving(this.field, 'focus');
+ Event.stopObserving(this.field, 'keyup');
+
+ Event.stopObserving(this.comboList.listParent, 'mousedown');
+ Event.stopObserving(this.comboList.listParent, 'mouseup');
+ Event.stopObserving(this.comboList.listParent, 'mousemove');
+ Event.stopObserving(this.comboList.listParent, 'click');
+
+ this.comboValue = null;
+ this.button = null;
+ this.buttonBG = null;
+ this.field = null;
+ this.classes = null;
+
+ delete this.comboList;
+ this.combobox.component = null;
+ this.combobox = null;
+ },
+
initHandlers : function() {
Event.observe(this.button, "click",
this.buttonClickHandler.bindAsEventListener(this));
Event.observe(this.button, "mouseup",
this.buttonMouseUpHandler.bindAsEventListener(this));
Show replies by date