mirror of
https://github.com/konvajs/konva.git
synced 2025-06-28 06:24:42 +08:00
fix: release cache canvas elements in Node.clearCache()
This commit is contained in:
parent
0f00aa9401
commit
d03b31f6ce
@ -243,7 +243,12 @@ export abstract class Node<Config extends NodeConfig = NodeConfig> {
|
|||||||
* node.clearCache();
|
* node.clearCache();
|
||||||
*/
|
*/
|
||||||
clearCache() {
|
clearCache() {
|
||||||
this._cache.delete(CANVAS);
|
if (this._cache.has(CANVAS)) {
|
||||||
|
const {scene, filter, hit} = this._cache.get(CANVAS);
|
||||||
|
Util.releaseCanvas(scene, filter, hit);
|
||||||
|
this._cache.delete(CANVAS);
|
||||||
|
}
|
||||||
|
|
||||||
this._clearSelfAndDescendantCache();
|
this._clearSelfAndDescendantCache();
|
||||||
this._requestDraw();
|
this._requestDraw();
|
||||||
return this;
|
return this;
|
||||||
|
Loading…
Reference in New Issue
Block a user