mirror of
https://github.com/konvajs/konva.git
synced 2025-04-05 20:48:28 +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();
|
||||
*/
|
||||
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._requestDraw();
|
||||
return this;
|
||||
|
Loading…
Reference in New Issue
Block a user