Browse Source

KERNEL-17875 fix: fineui Dep不能回收问题

research/test
翠屏山最速下山传说 9 months ago
parent
commit
e83a80916c
  1. 1
      packages/fineui/src/fix/fix.compact.js
  2. 10
      packages/fineui/src/fix/fix.js

1
packages/fineui/src/fix/fix.compact.js

@ -204,6 +204,7 @@ Widget.prototype.__destroy = function() {
unwatch(); unwatch();
}); });
}); });
Fix.cleanupDeps();
this._watchers && (this._watchers = []); this._watchers && (this._watchers = []);
if (this.store) { if (this.store) {
this.store._parent && (this.store._parent = null); this.store._parent && (this.store._parent = null);

10
packages/fineui/src/fix/fix.js

@ -110,7 +110,15 @@ function isExtensible(obj) {
function remove(arr, item) { function remove(arr, item) {
if (arr && arr.length) { if (!arr) {
return;
}
const len = arr.length;
if (len) {
if (item === arr[len - 1]) {
arr.length = len - 1;
return;
}
const index = arr.indexOf(item); const index = arr.indexOf(item);
if (index > -1) { if (index > -1) {
return arr.splice(index, 1); return arr.splice(index, 1);

Loading…
Cancel
Save