0
0
Fork 0
mirror of https://github.com/denoland/rusty_v8.git synced 2024-11-25 15:29:43 -05:00
denoland-rusty-v8/examples
Daniel Bevenius b1d31c7d76
Add dispose/shutdown_platform to hello_world (#532)
This commit adds calls to v8::V8::dispose and v8::V8::shutdown_platform
to the hello_world.rs example.

The motivation for adding this is that it was not obvious to me that I
needed to have the Isolate in a separate scope. If there is not, the
platform will have been shutdown before the Isolate's Drop function
is called at the end of the function where the scope ends. Drop will in
turn call Dispose on the V8 Isolate, which calls Isolate::Deinit, and
Deinit calls tracing_cpu_profilers.reset() which will call
~TracingCpuProfilerImpl which has a call to V8::GetCurrentPlatform()
which will produce the following error:

 Fatal error in ../../../v8/src/init/v8.cc, line 144
 Debug check failed: platform.

 FailureMessage Object: 0x7fff45b03700Illegal instruction (core dumped)

Having an example might safe others some time if they run into the same
issue.
2020-11-19 12:26:45 +01:00
..
count-hosts.js Add examples (#475) 2020-10-16 11:15:16 -04:00
hello_world.rs Add dispose/shutdown_platform to hello_world (#532) 2020-11-19 12:26:45 +01:00
process.rs Add examples (#475) 2020-10-16 11:15:16 -04:00
shell.rs Add examples (#475) 2020-10-16 11:15:16 -04:00