Commit 204f072
Gabriel Schulhof
objectwrap: remove wrap only on failure
`napi_remove_wrap()` was intended for objects that are alive for which
the native addon wishes to withdraw its native pointer, and perhaps
replace it with another.
Therefore we need not `napi_remove_wrap()` during gc/env-cleanup. It is
sufficient to `napi_delete_reference()`, as `Reference<Object>`
already does. We need only `napi_remove_wrap()` if the construction
failed and therefore no gc callback will ever happen.
This change also removes references to `ObjectWrapConstructionContext`
from the header because the class is not used anymore.
Fixes: #660
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
Reviewed-By: Kevin Eady <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>1 parent a552a38 commit 204f072
File tree
4 files changed
+33
-13
lines changed- test
4 files changed
+33
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2983 | 2983 | | |
2984 | 2984 | | |
2985 | 2985 | | |
2986 | | - | |
| 2986 | + | |
2987 | 2987 | | |
| 2988 | + | |
2988 | 2989 | | |
2989 | 2990 | | |
2990 | 2991 | | |
| |||
3380 | 3381 | | |
3381 | 3382 | | |
3382 | 3383 | | |
| 3384 | + | |
3383 | 3385 | | |
3384 | | - | |
| 3386 | + | |
3385 | 3387 | | |
3386 | | - | |
3387 | 3388 | | |
3388 | 3389 | | |
3389 | 3390 | | |
3390 | 3391 | | |
3391 | 3392 | | |
| 3393 | + | |
| 3394 | + | |
3392 | 3395 | | |
3393 | 3396 | | |
3394 | 3397 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
136 | 135 | | |
137 | 136 | | |
138 | 137 | | |
| |||
1378 | 1377 | | |
1379 | 1378 | | |
1380 | 1379 | | |
1381 | | - | |
1382 | 1380 | | |
1383 | 1381 | | |
1384 | 1382 | | |
| |||
1405 | 1403 | | |
1406 | 1404 | | |
1407 | 1405 | | |
1408 | | - | |
1409 | 1406 | | |
1410 | 1407 | | |
1411 | 1408 | | |
| |||
1738 | 1735 | | |
1739 | 1736 | | |
1740 | 1737 | | |
| 1738 | + | |
| 1739 | + | |
1741 | 1740 | | |
1742 | 1741 | | |
1743 | 1742 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | 4 | | |
6 | 5 | | |
7 | 6 | | |
| |||
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
| 23 | + | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
25 | 28 | | |
26 | 29 | | |
27 | 30 | | |
| |||
30 | 33 | | |
31 | 34 | | |
32 | 35 | | |
33 | | - | |
| 36 | + | |
34 | 37 | | |
35 | 38 | | |
36 | 39 | | |
37 | | - | |
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
41 | | - | |
42 | 43 | | |
43 | | - | |
44 | 44 | | |
45 | 45 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
2 | 8 | | |
3 | 9 | | |
| 10 | + | |
4 | 11 | | |
5 | | - | |
| 12 | + | |
| 13 | + | |
6 | 14 | | |
7 | 15 | | |
8 | 16 | | |
| |||
12 | 20 | | |
13 | 21 | | |
14 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
15 | 32 | | |
16 | 33 | | |
17 | | - | |
| 34 | + | |
| 35 | + | |
0 commit comments