diff options
Diffstat (limited to 'ui')
-rw-r--r-- | ui/widget.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ui/widget.js b/ui/widget.js index d5a76c67d..6ef161591 100644 --- a/ui/widget.js +++ b/ui/widget.js @@ -442,8 +442,14 @@ $.Widget.prototype = { }, _off: function( element, eventName ) { - eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) + this.eventNamespace; + eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) + + this.eventNamespace; element.unbind( eventName ).undelegate( eventName ); + + // Clear the stack to avoid memory leaks (#10056) + this.bindings = $( this.bindings.not( element ).get() ); + this.focusable = $( this.focusable.not( element ).get() ); + this.hoverable = $( this.hoverable.not( element ).get() ); }, _delay: function( handler, delay ) { |