Commit 58dc92f
ffi: support Symbol.dispose on DynamicLibrary
Install [Symbol.dispose]() on DynamicLibrary.prototype (calling close())
and on the object returned from ffi.dlopen(), so both can be used with
the `using` declaration for automatic cleanup.
Signed-off-by: Matteo Collina <hello@matteocollina.com>
PR-URL: #62925
Reviewed-By: Bryan English <bryan@bryanenglish.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Anna Henningsen <anna@addaleax.net>1 parent 528f8b2 commit 58dc92fCopy full SHA for 58dc92f
3 files changed
+110-1Lines changed: 110 additions & 1 deletion
File tree
Expand file treeCollapse file tree
Open diff view settings
Filter options
- doc/api
- lib
- test/ffi
Expand file treeCollapse file tree
Open diff view settings
Collapse file
+41Lines changed: 41 additions & 0 deletions
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
182 | 182 | |
183 | 183 | |
184 | 184 | |
| 185 | + |
| 186 | + |
| 187 | + |
| 188 | + |
| 189 | + |
| 190 | + |
| 191 | + |
| 192 | + |
| 193 | + |
| 194 | + |
| 195 | + |
| 196 | + |
| 197 | + |
| 198 | + |
| 199 | + |
185 | 200 | |
186 | 201 | |
187 | 202 | |
| ||
275 | 290 | |
276 | 291 | |
277 | 292 | |
| 293 | + |
| 294 | + |
| 295 | + |
| 296 | + |
| 297 | + |
| 298 | + |
| 299 | + |
| 300 | + |
| 301 | + |
| 302 | + |
| 303 | + |
| 304 | + |
| 305 | + |
| 306 | + |
| 307 | + |
278 | 308 | |
279 | 309 | |
280 | 310 | |
| ||
295 | 325 | |
296 | 326 | |
297 | 327 | |
| 328 | + |
| 329 | + |
| 330 | + |
| 331 | + |
| 332 | + |
| 333 | + |
| 334 | + |
| 335 | + |
| 336 | + |
| 337 | + |
298 | 338 | |
299 | 339 | |
300 | 340 | |
| ||
684 | 724 | |
685 | 725 | |
686 | 726 | |
| 727 | + |
Collapse file
+10-1Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
3 | 3 | |
4 | 4 | |
5 | 5 | |
| 6 | + |
6 | 7 | |
7 | 8 | |
8 | 9 | |
| ||
55 | 56 | |
56 | 57 | |
57 | 58 | |
| 59 | + |
| 60 | + |
| 61 | + |
| 62 | + |
58 | 63 | |
59 | 64 | |
60 | 65 | |
| ||
71 | 76 | |
72 | 77 | |
73 | 78 | |
74 | | - |
| 79 | + |
| 80 | + |
| 81 | + |
| 82 | + |
| 83 | + |
75 | 84 | |
76 | 85 | |
77 | 86 | |
|
Collapse file
test/ffi/test-ffi-dynamic-library.js
Copy file name to clipboardExpand all lines: test/ffi/test-ffi-dynamic-library.js+59Lines changed: 59 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
129 | 129 | |
130 | 130 | |
131 | 131 | |
| 132 | + |
| 133 | + |
| 134 | + |
| 135 | + |
| 136 | + |
| 137 | + |
| 138 | + |
| 139 | + |
| 140 | + |
| 141 | + |
| 142 | + |
| 143 | + |
| 144 | + |
| 145 | + |
| 146 | + |
| 147 | + |
| 148 | + |
| 149 | + |
| 150 | + |
| 151 | + |
| 152 | + |
| 153 | + |
| 154 | + |
| 155 | + |
| 156 | + |
| 157 | + |
| 158 | + |
| 159 | + |
| 160 | + |
| 161 | + |
| 162 | + |
| 163 | + |
| 164 | + |
| 165 | + |
| 166 | + |
| 167 | + |
| 168 | + |
| 169 | + |
| 170 | + |
| 171 | + |
| 172 | + |
| 173 | + |
| 174 | + |
| 175 | + |
| 176 | + |
| 177 | + |
| 178 | + |
| 179 | + |
| 180 | + |
| 181 | + |
| 182 | + |
| 183 | + |
| 184 | + |
| 185 | + |
| 186 | + |
| 187 | + |
| 188 | + |
| 189 | + |
| 190 | + |
132 | 191 | |
133 | 192 | |
134 | 193 | |
|
0 commit comments