Repository navigation
Commit 30dcffb
committed
process: return unregister fn from finalization
process.finalization.register() and registerBeforeExit() now return
a function that removes only that registration, leaving other
registrations for the same object in place. The function does not
hold a strong reference to the object.
Each registration now uses its WeakRef as the unregister token, which
also makes process.finalization.unregister() remove the entries from
the FinalizationRegistry; previously it passed the object as the
token, which was never registered, so the call had no effect.
Refs: #66482
Signed-off-by: Matteo Collina <matteo.collina@gmail.com>
Assisted-by: pi1 parent cbac135 commit 30dcffb
4 files changed
Lines changed: 67 additions & 5 deletions
File tree
- doc/api
- lib/internal/process
- test
- fixtures/process
- parallel
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2064 | 2064 | | |
2065 | 2065 | | |
2066 | 2066 | | |
| 2067 | + | |
| 2068 | + | |
| 2069 | + | |
2067 | 2070 | | |
2068 | 2071 | | |
2069 | 2072 | | |
| |||
2075 | 2078 | | |
2076 | 2079 | | |
2077 | 2080 | | |
| 2081 | + | |
2078 | 2082 | | |
2079 | 2083 | | |
2080 | 2084 | | |
| |||
2171 | 2175 | | |
2172 | 2176 | | |
2173 | 2177 | | |
| 2178 | + | |
| 2179 | + | |
| 2180 | + | |
| 2181 | + | |
| 2182 | + | |
| 2183 | + | |
| 2184 | + | |
| 2185 | + | |
| 2186 | + | |
| 2187 | + | |
| 2188 | + | |
2174 | 2189 | | |
2175 | 2190 | | |
2176 | 2191 | | |
2177 | 2192 | | |
2178 | 2193 | | |
2179 | 2194 | | |
| 2195 | + | |
| 2196 | + | |
| 2197 | + | |
2180 | 2198 | | |
2181 | 2199 | | |
2182 | 2200 | | |
| |||
2189 | 2207 | | |
2190 | 2208 | | |
2191 | 2209 | | |
| 2210 | + | |
2192 | 2211 | | |
2193 | 2212 | | |
2194 | 2213 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
88 | 88 | | |
89 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
90 | 100 | | |
91 | 101 | | |
92 | 102 | | |
93 | 103 | | |
94 | 104 | | |
95 | 105 | | |
96 | 106 | | |
| 107 | + | |
97 | 108 | | |
98 | 109 | | |
99 | 110 | | |
100 | 111 | | |
101 | | - | |
| 112 | + | |
102 | 113 | | |
103 | 114 | | |
104 | 115 | | |
105 | 116 | | |
106 | 117 | | |
107 | 118 | | |
108 | 119 | | |
| 120 | + | |
109 | 121 | | |
110 | 122 | | |
111 | 123 | | |
112 | 124 | | |
113 | | - | |
| 125 | + | |
114 | 126 | | |
115 | 127 | | |
116 | 128 | | |
| |||
121 | 133 | | |
122 | 134 | | |
123 | 135 | | |
124 | | - | |
125 | 136 | | |
126 | 137 | | |
127 | 138 | | |
128 | 139 | | |
129 | 140 | | |
| 141 | + | |
130 | 142 | | |
131 | 143 | | |
132 | | - | |
133 | 144 | | |
| 145 | + | |
| 146 | + | |
134 | 147 | | |
135 | 148 | | |
136 | 149 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
0 commit comments