Commit 135a84a
committed
Allow garbage collection of inherited transition.
When creating a new transition derived from an existing transition, the new
transition’s parameters (reference time, delay, duration and easing) are
inherited. However, we were inadvertantly also capturing a reference to the old
transition lock, including any tweens and listeners. Even though this object
wasn’t used by the transition after creation, it’s likely that the garbage
collector wasn’t smart enough to free the old lock. We now set the lock to null
explicitly so as to allow garbage collection and avoid a memory leak with
chained transitions. Related d3#2110.
Also, create a new object when using transition.transition rather than using
Object.create. It’s slightly more code, but it’s simpler.1 parent d659844 commit 135a84a
4 files changed
Lines changed: 14 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8576 | 8576 | | |
8577 | 8577 | | |
8578 | 8578 | | |
8579 | | - | |
8580 | | - | |
8581 | | - | |
| 8579 | + | |
| 8580 | + | |
| 8581 | + | |
| 8582 | + | |
| 8583 | + | |
| 8584 | + | |
| 8585 | + | |
8582 | 8586 | | |
8583 | 8587 | | |
8584 | 8588 | | |
| |||
8599 | 8603 | | |
8600 | 8604 | | |
8601 | 8605 | | |
| 8606 | + | |
8602 | 8607 | | |
8603 | 8608 | | |
8604 | 8609 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
18 | | - | |
| 16 | + | |
| 17 | + | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
63 | 65 | | |
64 | 66 | | |
65 | 67 | | |
| |||
0 commit comments