Commit 1b76cfe
src: use unique_ptr for scheduled delayed tasks
Use std::unique_ptr for delayed tasks in the scheduled
delayed tasks vector. This makes it clear that the vector
has ownership of the delayed tasks and is responsible for
deleting them.
Use a custom deleter for the pointers because libuv
needs to close the handle and then delete the data. Provide
the handle when creating the pointer instead of invoking the
special delete action everytime an element is removed from the vector.
PR-URL: #17083
Reviewed-By: Anna Henningsen <anna@addaleax.net>1 parent af63df8 commit 1b76cfeCopy full SHA for 1b76cfe
File tree
Expand file treeCollapse file tree
2 files changed
+26
-16
lines changedOpen diff view settings
Filter options
- src
Expand file treeCollapse file tree
2 files changed
+26
-16
lines changedOpen diff view settings
Collapse file
+19-15Lines changed: 19 additions & 15 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
134 | 134 | |
135 | 135 | |
136 | 136 | |
| 137 | + |
| 138 | + |
| 139 | + |
| 140 | + |
| 141 | + |
| 142 | + |
| 143 | + |
| 144 | + |
| 145 | + |
| 146 | + |
137 | 147 | |
138 | 148 | |
139 | | - |
140 | | - |
141 | | - |
142 | | - |
143 | 149 | |
144 | | - |
145 | | - |
146 | | - |
147 | | - |
| 150 | + |
148 | 151 | |
149 | 152 | |
150 | 153 | |
151 | | - |
152 | | - |
153 | | - |
154 | | - |
155 | | - |
156 | | - |
157 | 154 | |
158 | 155 | |
159 | 156 | |
| ||
183 | 180 | |
184 | 181 | |
185 | 182 | |
186 | | - |
| 183 | + |
| 184 | + |
| 185 | + |
| 186 | + |
| 187 | + |
| 188 | + |
| 189 | + |
| 190 | + |
187 | 191 | |
188 | 192 | |
189 | 193 | |
|
Collapse file
+7-1Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
64 | 64 | |
65 | 65 | |
66 | 66 | |
| 67 | + |
| 68 | + |
67 | 69 | |
68 | 70 | |
69 | 71 | |
| ||
74 | 76 | |
75 | 77 | |
76 | 78 | |
77 | | - |
| 79 | + |
| 80 | + |
| 81 | + |
| 82 | + |
| 83 | + |
78 | 84 | |
79 | 85 | |
80 | 86 | |
|
0 commit comments