Commit e8e6141
committed
fix(template-outlet): memory leak for cached templates
When a TemplateOutlet instance was being destroyed all
its locally cached views were not being destroyed.
The parent component (grid) was attempting to clean up all the template outlets
on the its destroy. But, this approach is weak because TemplateOutlets could
have been destroyed along the way (resize, groupby, etc),
so all those caches would have never been destroyed.
The new strategy:
* uniquely identified views (templateID.id) are meant to be managed by the
parent component, so now the parent component destroys them directly and the
template outlet never caches them locally.
* other templates (local) are destroyed by the template outlet destroy.1 parent 141ca8c commit e8e6141
File tree
6 files changed
+59
-35
lines changed- projects/igniteui-angular/src/lib
- directives/template-outlet
- grids
- grid
- hierarchical-grid
6 files changed
+59
-35
lines changedLines changed: 29 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | | - | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
54 | 59 | | |
55 | 60 | | |
56 | 61 | | |
| |||
63 | 68 | | |
64 | 69 | | |
65 | 70 | | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | 71 | | |
76 | 72 | | |
77 | 73 | | |
| |||
88 | 84 | | |
89 | 85 | | |
90 | 86 | | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
| 87 | + | |
97 | 88 | | |
98 | 89 | | |
99 | 90 | | |
| |||
105 | 96 | | |
106 | 97 | | |
107 | 98 | | |
108 | | - | |
| 99 | + | |
109 | 100 | | |
110 | 101 | | |
111 | 102 | | |
| |||
197 | 188 | | |
198 | 189 | | |
199 | 190 | | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
200 | 211 | | |
201 | 212 | | |
202 | 213 | | |
| |||
Lines changed: 1 addition & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| |||
1329 | 1329 | | |
1330 | 1330 | | |
1331 | 1331 | | |
1332 | | - | |
1333 | | - | |
1334 | | - | |
1335 | | - | |
1336 | | - | |
1337 | | - | |
1338 | 1332 | | |
1339 | 1333 | | |
1340 | 1334 | | |
| |||
4109 | 4103 | | |
4110 | 4104 | | |
4111 | 4105 | | |
4112 | | - | |
4113 | | - | |
4114 | | - | |
4115 | 4106 | | |
4116 | 4107 | | |
4117 | 4108 | | |
| |||
Lines changed: 2 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2532 | 2532 | | |
2533 | 2533 | | |
2534 | 2534 | | |
2535 | | - | |
2536 | | - | |
2537 | | - | |
| 2535 | + | |
2538 | 2536 | | |
2539 | 2537 | | |
2540 | 2538 | | |
| |||
2693 | 2691 | | |
2694 | 2692 | | |
2695 | 2693 | | |
2696 | | - | |
| 2694 | + | |
2697 | 2695 | | |
2698 | 2696 | | |
2699 | 2697 | | |
| |||
Lines changed: 14 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
| 158 | + | |
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
| |||
1069 | 1069 | | |
1070 | 1070 | | |
1071 | 1071 | | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
1072 | 1084 | | |
1073 | 1085 | | |
1074 | 1086 | | |
| |||
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
865 | 865 | | |
866 | 866 | | |
867 | 867 | | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
868 | 874 | | |
869 | 875 | | |
870 | 876 | | |
| |||
926 | 932 | | |
927 | 933 | | |
928 | 934 | | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
929 | 939 | | |
930 | 940 | | |
931 | 941 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
566 | 566 | | |
567 | 567 | | |
568 | 568 | | |
569 | | - | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
570 | 572 | | |
571 | 573 | | |
572 | 574 | | |
| |||
0 commit comments