fix: improved memory profile for transitions/animations (#12796)

* fix: improved memory profile for transitions/animations

* put back the catch
pull/12797/head
Dominic Gannaway 5 months ago committed by GitHub
parent 4aa6059712
commit 97c0150b00
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: improved memory profile for transitions/animations

@ -448,9 +448,15 @@ function animate(element, options, counterpart, t2, on_finish, on_abort) {
return {
abort: () => {
animation?.cancel();
if (animation) {
animation.cancel();
// This prevents memory leaks in Chromium
animation.effect = null;
}
task?.abort();
on_abort?.();
on_finish = undefined;
on_abort = undefined;
},
deactivate: () => {
on_finish = undefined;

Loading…
Cancel
Save