This repository was archived by the owner on Feb 24, 2025. It is now read-only.
Commit b1cb778
authored
Remove NewTabPage retain cycles (#3532)
Task/Issue URL:
https://app.asana.com/0/1206226850447395/1208686031091434/f
Tech Design URL:
CC:
**Description**:
Leak 1:
`NewTabPageViewController` was not dismissed properly, this caused it to
stay in memory as a child view controller of `MainViewController`.
In effect it was possible to dismiss FaviconFetcherTutorial. Removing
the leak required to do additional changes to make it work. I moved it
to `MainViewController`, so that it's not dependent on NewTabPage.
Leak 2:
`NewTabPageSettingsModel` was leaking via strong reference present in
`NTPSettingItem`.
**Steps to test this PR**:
1. Set up Sync.
2. Add favorite.
3. On another synced device open New Tab Page
4. Favicon Tutorial should appear, see if buttons work, dismissing the
tutorial
5. Open and close New Tab Page a few times.
6. Open Memory Graph Debugger, verify only single instance is present
for `NewTabPageViewController` and `NewTabPageSettingsModel*` objects.
**Definition of Done (Internal Only)**:
* [ ] Does this PR satisfy our [Definition of
Done](https://app.asana.com/0/1202500774821704/1207634633537039/f)?
---
###### Internal references:
[Software Engineering
Expectations](https://app.asana.com/0/59792373528535/199064865822552)
[Technical Design
Template](https://app.asana.com/0/59792373528535/184709971311943)1 parent 2b49550 commit b1cb778
File tree
5 files changed
+20
-29
lines changed- DuckDuckGoTests
- DuckDuckGo
5 files changed
+20
-29
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| 131 | + | |
131 | 132 | | |
132 | 133 | | |
133 | 134 | | |
| |||
795 | 796 | | |
796 | 797 | | |
797 | 798 | | |
798 | | - | |
799 | | - | |
800 | 799 | | |
801 | 800 | | |
802 | 801 | | |
| |||
2172 | 2171 | | |
2173 | 2172 | | |
2174 | 2173 | | |
| 2174 | + | |
| 2175 | + | |
| 2176 | + | |
| 2177 | + | |
2175 | 2178 | | |
2176 | 2179 | | |
2177 | 2180 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
30 | 28 | | |
31 | 29 | | |
32 | 30 | | |
33 | 31 | | |
34 | | - | |
35 | | - | |
36 | 32 | | |
37 | 33 | | |
38 | 34 | | |
| |||
53 | 49 | | |
54 | 50 | | |
55 | 51 | | |
56 | | - | |
57 | | - | |
58 | 52 | | |
59 | 53 | | |
60 | 54 | | |
| |||
63 | 57 | | |
64 | 58 | | |
65 | 59 | | |
66 | | - | |
67 | | - | |
68 | 60 | | |
69 | 61 | | |
70 | 62 | | |
| |||
145 | 137 | | |
146 | 138 | | |
147 | 139 | | |
148 | | - | |
| 140 | + | |
| 141 | + | |
149 | 142 | | |
150 | 143 | | |
151 | 144 | | |
| |||
215 | 208 | | |
216 | 209 | | |
217 | 210 | | |
218 | | - | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
219 | 215 | | |
220 | 216 | | |
221 | 217 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
| 41 | + | |
49 | 42 | | |
50 | 43 | | |
51 | 44 | | |
| |||
60 | 53 | | |
61 | 54 | | |
62 | 55 | | |
63 | | - | |
64 | | - | |
65 | 56 | | |
66 | 57 | | |
67 | 58 | | |
| |||
0 commit comments