Commit 9e2554c
committed
src: use cleanup hooks to tear down BaseObjects
Clean up after `BaseObject` instances when the `Environment`
is being shut down. This takes care of closing non-libuv resources
like `zlib` instances, which do not require asynchronous shutdown.
Many thanks for Stephen Belanger, Timothy Gu and Alexey Orlenko for
reviewing the original version of this commit in the Ayo.js project.
Refs: ayojs/ayo#88
PR-URL: #19377
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>1 parent 8995408 commit 9e2554cCopy full SHA for 9e2554c
File tree
Expand file treeCollapse file tree
6 files changed
+21
-2
lines changedOpen diff view settings
Filter options
- src
Expand file treeCollapse file tree
6 files changed
+21
-2
lines changedOpen diff view settings
Collapse file
+9Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
37 | 37 | |
38 | 38 | |
39 | 39 | |
| 40 | + |
40 | 41 | |
41 | 42 | |
42 | 43 | |
43 | 44 | |
| 45 | + |
| 46 | + |
44 | 47 | |
45 | 48 | |
46 | 49 | |
| ||
80 | 83 | |
81 | 84 | |
82 | 85 | |
| 86 | + |
| 87 | + |
| 88 | + |
| 89 | + |
| 90 | + |
| 91 | + |
83 | 92 | |
84 | 93 | |
85 | 94 | |
|
Collapse file
+2Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
71 | 71 | |
72 | 72 | |
73 | 73 | |
| 74 | + |
| 75 | + |
74 | 76 | |
75 | 77 | |
76 | 78 | |
|
Collapse file
+6Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
133 | 133 | |
134 | 134 | |
135 | 135 | |
| 136 | + |
| 137 | + |
| 138 | + |
| 139 | + |
136 | 140 | |
137 | 141 | |
138 | 142 | |
| ||
245 | 249 | |
246 | 250 | |
247 | 251 | |
| 252 | + |
| 253 | + |
248 | 254 | |
249 | 255 | |
250 | 256 | |
|
Collapse file
+2Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
576 | 576 | |
577 | 577 | |
578 | 578 | |
| 579 | + |
| 580 | + |
579 | 581 | |
580 | 582 | |
581 | 583 | |
|
Collapse file
+2-1Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
4578 | 4578 | |
4579 | 4579 | |
4580 | 4580 | |
| 4581 | + |
| 4582 | + |
4581 | 4583 | |
4582 | 4584 | |
4583 | 4585 | |
4584 | 4586 | |
4585 | 4587 | |
4586 | | - |
4587 | 4588 | |
4588 | 4589 | |
4589 | 4590 | |
|
Collapse file
-1Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
26 | 26 | |
27 | 27 | |
28 | 28 | |
29 | | - |
30 | 29 | |
31 | 30 | |
32 | 31 | |
|
0 commit comments