@leafer/core 1.4.1 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/core.cjs +10 -9
- package/lib/core.cjs.map +1 -1
- package/lib/core.esm.js +10 -9
- package/lib/core.esm.js.map +1 -1
- package/lib/core.esm.min.js +1 -1
- package/lib/core.esm.min.js.map +1 -1
- package/lib/core.min.cjs +1 -1
- package/lib/core.min.cjs.map +1 -1
- package/package.json +17 -17
- package/src/index.ts +1 -1
- package/types/index.d.ts +1 -1
package/lib/core.cjs
CHANGED
|
@@ -3637,7 +3637,12 @@ const Resource = {
|
|
|
3637
3637
|
return R.map[key];
|
|
3638
3638
|
},
|
|
3639
3639
|
remove(key) {
|
|
3640
|
-
|
|
3640
|
+
const r = R.map[key];
|
|
3641
|
+
if (r) {
|
|
3642
|
+
if (r.destroy)
|
|
3643
|
+
r.destroy();
|
|
3644
|
+
delete R.map[key];
|
|
3645
|
+
}
|
|
3641
3646
|
},
|
|
3642
3647
|
loadImage(key, format) {
|
|
3643
3648
|
return new Promise((resolve, reject) => {
|
|
@@ -3663,6 +3668,7 @@ const Resource = {
|
|
|
3663
3668
|
const R = Resource;
|
|
3664
3669
|
|
|
3665
3670
|
const ImageManager = {
|
|
3671
|
+
maxRecycled: 100,
|
|
3666
3672
|
recycledList: [],
|
|
3667
3673
|
patternTasker: new TaskProcessor(),
|
|
3668
3674
|
get(config) {
|
|
@@ -3679,13 +3685,8 @@ const ImageManager = {
|
|
|
3679
3685
|
},
|
|
3680
3686
|
clearRecycled() {
|
|
3681
3687
|
const list = I.recycledList;
|
|
3682
|
-
if (list.length >
|
|
3683
|
-
list.forEach(image =>
|
|
3684
|
-
if (!image.use && image.url) {
|
|
3685
|
-
Resource.remove(image.url);
|
|
3686
|
-
image.destroy();
|
|
3687
|
-
}
|
|
3688
|
-
});
|
|
3688
|
+
if (list.length > I.maxRecycled) {
|
|
3689
|
+
list.forEach(image => (!image.use && image.url) && Resource.remove(image.url));
|
|
3689
3690
|
list.length = 0;
|
|
3690
3691
|
}
|
|
3691
3692
|
},
|
|
@@ -6053,7 +6054,7 @@ class LeafLevelList {
|
|
|
6053
6054
|
}
|
|
6054
6055
|
}
|
|
6055
6056
|
|
|
6056
|
-
const version = "1.4.
|
|
6057
|
+
const version = "1.4.2";
|
|
6057
6058
|
|
|
6058
6059
|
exports.AlignHelper = AlignHelper;
|
|
6059
6060
|
exports.AroundHelper = AroundHelper;
|