Browse Source

remove event listener on destroy

burnb 10 years ago
parent
commit
557f655c86
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/js/select2/core.js

+ 2 - 0
src/js/select2/core.js

@@ -443,6 +443,8 @@ define([
     if (this._observer != null) {
       this._observer.disconnect();
       this._observer = null;
+    } else if (this.$element[0].removeEventListener) {
+      this.$element[0].removeEventListener('DOMAttrModified', this._sync, false);
     }
 
     this._sync = null;