Browse Source

Pull request #2843: KERNEL-11580 fix: 内存泄漏问题

Merge in VISUAL/fineui from ~DAILER/fineui:master to master

* commit 'f77d9b396e63ebfd3be6812aa767f9ad770907af':
  KERNEL-11580 fix: 内存泄漏问题
es6
Dailer 2 years ago
parent
commit
4548006800
  1. 4
      src/base/combination/bubble.js
  2. 4
      src/base/combination/combo.js
  3. 4
      src/base/combination/expander.js
  4. 4
      src/base/combination/switcher.js
  5. 4
      src/base/single/button/button.basic.js
  6. 6
      src/core/4.widget.js

4
src/base/combination/bubble.js

@ -44,7 +44,9 @@
var self = this, o = this.options;
this._initCombo();
// 延迟绑定事件,这样可以将自己绑定的事情优先执行
BI.nextTick(this._initPullDownAction.bind(this));
BI.nextTick(() => {
!this.isDestroyed() && this._initPullDownAction();
});
this.combo.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
if (self.isEnabled() && self.isValid()) {
if (type === BI.Events.EXPAND) {

4
src/base/combination/combo.js

@ -50,7 +50,9 @@
var self = this, o = this.options;
this._initCombo();
// 延迟绑定事件,这样可以将自己绑定的事情优先执行
BI.nextTick(this._initPullDownAction.bind(this));
BI.nextTick(() => {
!this.isDestroyed() && this._initPullDownAction();
});
this.combo.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
if (self.isEnabled() && self.isValid()) {
if (type === BI.Events.EXPAND) {

4
src/base/combination/expander.js

@ -26,7 +26,9 @@ BI.Expander = BI.inherit(BI.Widget, {
this._expanded = !!o.el.open;
this._initExpander();
// 延迟绑定事件,这样可以将自己绑定的事情优先执行
BI.nextTick(this._initPullDownAction.bind(this));
BI.nextTick(() => {
!this.isDestroyed() && this._initPullDownAction();
});
this.expander.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
if (self.isEnabled() && self.isValid()) {
if (type === BI.Events.EXPAND) {

4
src/base/combination/switcher.js

@ -26,7 +26,9 @@ BI.Switcher = BI.inherit(BI.Widget, {
var self = this, o = this.options;
this._initSwitcher();
// 延迟绑定事件,这样可以将自己绑定的事情优先执行
BI.nextTick(this._initPullDownAction.bind(this));
BI.nextTick(() => {
!this.isDestroyed() && this._initPullDownAction();
});
this.switcher.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
if (self.isEnabled() && self.isValid()) {
if (type === BI.Events.EXPAND) {

4
src/base/single/button/button.basic.js

@ -49,7 +49,9 @@ BI.BasicButton = BI.inherit(BI.Single, {
this.setSelected(true);
}
// 延迟绑定事件,这样可以将自己绑定的事情优先执行
BI.nextTick(this.bindEvent.bind(this));
BI.nextTick(() => {
!this.isDestroyed() && this.bindEvent();
});
BI.BasicButton.superclass._initRef.apply(this, arguments);
},

6
src/core/4.widget.js

@ -346,6 +346,7 @@
_initState: function () {
this._isMounted = false;
this._isDestroyed = false;
},
__initWatch: function () {
@ -449,6 +450,10 @@
return this._isMounted;
},
isDestroyed: function () {
return this._isDestroyed;
},
setWidth: function (w) {
this.options.width = w;
this._initElementWidth();
@ -732,6 +737,7 @@
this._isMounted = false;
callLifeHook(this, "destroyed");
this.destroyed = null;
this._isDestroyed = true;
},
_unMount: function () {

Loading…
Cancel
Save