Commit a9460d0
fix(zone.js): remove
This commit updates the implementation of the `addEventListener` patcher.
We're currently creating an abort event listener on the signal (when it's provided)
and never remove it. The abort event listener creates a closure which captures `task`
(tasks capture zones and other stuff too) and prevent `task`, zones and signals from
being garbage collected.
We now store the function which removes the abort event listener when the actual event
listener is being removed. The function is stored on task data since task data is already
being used to store different types of information that's necessary to be shared between
`addEventListener` and `removeEventListener`.
Closes #54739
PR Close #55339abort listener on a signal when actual event is removed (#55339)1 parent afc057e commit a9460d0
1 file changed
Lines changed: 23 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
427 | 427 | | |
428 | 428 | | |
429 | 429 | | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | | - | |
434 | | - | |
435 | | - | |
436 | | - | |
| 430 | + | |
437 | 431 | | |
438 | 432 | | |
439 | 433 | | |
| |||
528 | 522 | | |
529 | 523 | | |
530 | 524 | | |
531 | | - | |
532 | | - | |
533 | | - | |
534 | | - | |
535 | | - | |
536 | | - | |
537 | | - | |
538 | | - | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
539 | 537 | | |
540 | 538 | | |
541 | 539 | | |
| |||
620 | 618 | | |
621 | 619 | | |
622 | 620 | | |
623 | | - | |
| 621 | + | |
624 | 622 | | |
625 | 623 | | |
626 | 624 | | |
| |||
643 | 641 | | |
644 | 642 | | |
645 | 643 | | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
646 | 653 | | |
647 | 654 | | |
648 | 655 | | |
| |||
0 commit comments