Commit c49c8da
authored
fix: Ensure all stateOwnersUpdateHandlers are properly torn down (#1237)
Resolve #1212
## Problem
Only the last handler's teardown in `stateOwnersUpdateHandlers` was
called when a media element changed, causing memory leaks and stale
listeners.
## Solution
- Store all teardown functions in an array
- Call every teardown when state owners change
- Ignore handlers that don’t return a teardown1 parent 58d1e1b commit c49c8da
1 file changed
+23
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
455 | 455 | | |
456 | 456 | | |
457 | 457 | | |
458 | | - | |
| 458 | + | |
459 | 459 | | |
460 | | - | |
461 | | - | |
462 | | - | |
463 | | - | |
464 | | - | |
465 | | - | |
466 | | - | |
467 | | - | |
468 | | - | |
469 | | - | |
470 | | - | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
471 | 482 | | |
472 | 483 | | |
473 | 484 | | |
| |||
0 commit comments