Commit ec3e5b4
node-api: avoid SecondPassCallback crash
PR #38000 added
indirection so that we could stop finalization in
cases where it had been scheduled in a second
pass callback but we were doing it in advance in
environment teardown.
Unforunately we missed that the code which tries
to clear the second pass parameter checked if
the pointer to the parameter (_secondPassParameter)
was nullptr and that when the second pass callback
was scheduled we set _secondPassParameter to nullptr
in order to avoid it being deleted outside of the second
pass callback. The net result was that we
would not clear the _secondPassParameter contents
and failed to avoid the Finalization in the second pass
callback.
This PR adds an additional boolean for deciding if
the secondPassParameter should be deleted outside
of the second pass callback instead of setting
secondPassParameter to nullptr thus avoiding the
conflict between the 2 ways it was being used.
See the discussion starting at:
#38273 (comment)
for how this was discovered on OSX while trying to
upgrade to a new V8 version.
Signed-off-by: Michael Dawson <[email protected]>
PR-URL: #38899
Reviewed-By: Chengzhong Wu <[email protected]>
Reviewed-By: James M Snell <[email protected]>1 parent 5b5e07a commit ec3e5b4
1 file changed
+6
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
321 | 321 | | |
322 | 322 | | |
323 | 323 | | |
324 | | - | |
| 324 | + | |
| 325 | + | |
325 | 326 | | |
326 | 327 | | |
327 | 328 | | |
| |||
348 | 349 | | |
349 | 350 | | |
350 | 351 | | |
351 | | - | |
| 352 | + | |
352 | 353 | | |
353 | 354 | | |
354 | 355 | | |
| |||
445 | 446 | | |
446 | 447 | | |
447 | 448 | | |
448 | | - | |
449 | | - | |
| 449 | + | |
450 | 450 | | |
451 | 451 | | |
452 | 452 | | |
| |||
468 | 468 | | |
469 | 469 | | |
470 | 470 | | |
| 471 | + | |
471 | 472 | | |
472 | 473 | | |
473 | 474 | | |
474 | 475 | | |
475 | 476 | | |
476 | 477 | | |
| 478 | + | |
477 | 479 | | |
478 | 480 | | |
479 | 481 | | |
| |||
0 commit comments