Commit 611dcfb
committed
fix($rootScope): fix potential memory leak when removing scope listeners
When removing listeners they are removed from the array but the array size
is not changed until the event is fired again. If the event is never fired
but listeners are added/removed then the array will continue growing.
By changing the listener removal to `delete` the array entry instead of setting
it to `null` browsers can potentially deallocate the memory for the entry.
Fixes angular#16135
Closes angular#161611 parent 00f1d27 commit 611dcfb
2 files changed
+19
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1183 | 1183 | | |
1184 | 1184 | | |
1185 | 1185 | | |
1186 | | - | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
1187 | 1190 | | |
1188 | 1191 | | |
1189 | 1192 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2316 | 2316 | | |
2317 | 2317 | | |
2318 | 2318 | | |
| 2319 | + | |
| 2320 | + | |
| 2321 | + | |
| 2322 | + | |
| 2323 | + | |
| 2324 | + | |
| 2325 | + | |
| 2326 | + | |
| 2327 | + | |
| 2328 | + | |
| 2329 | + | |
| 2330 | + | |
| 2331 | + | |
| 2332 | + | |
| 2333 | + | |
2319 | 2334 | | |
2320 | 2335 | | |
2321 | 2336 | | |
| |||
0 commit comments