Commit 45e3e72
committed
fix(cdk/table): memory leak when no rows are sticky (#30461)
The table has some logic that queues up measurements of rows that will become sticky so that they can be measured once we set up the resize observer. Afterwards the queue is cleared once the measurements are done. #29814 introduced a memory leak where the tracking was happening even if the row isn't actually sticky which meant that the resize observer was never set up and the queue kept growing as new rows are rendered.
These changes resolve the leak by only queuing the measurement if it's necessary.
I've also fixed another potential leak where we were setting up the resize observer, but we weren't destroying it.
Fixes #30453.
(cherry picked from commit bf94082)1 parent 9b323df commit 45e3e72
1 file changed
+15
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
| 131 | + | |
139 | 132 | | |
140 | 133 | | |
141 | 134 | | |
142 | 135 | | |
143 | 136 | | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
| 137 | + | |
| 138 | + | |
149 | 139 | | |
150 | 140 | | |
151 | 141 | | |
| |||
164 | 154 | | |
165 | 155 | | |
166 | 156 | | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
167 | 165 | | |
168 | 166 | | |
169 | 167 | | |
| |||
321 | 319 | | |
322 | 320 | | |
323 | 321 | | |
| 322 | + | |
324 | 323 | | |
325 | 324 | | |
326 | 325 | | |
| |||
493 | 492 | | |
494 | 493 | | |
495 | 494 | | |
496 | | - | |
497 | | - | |
| 495 | + | |
| 496 | + | |
498 | 497 | | |
499 | | - | |
500 | | - | |
501 | 498 | | |
502 | 499 | | |
503 | 500 | | |
| |||
0 commit comments