summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2019-01-12 21:26:12 +0100
committerJoyee Cheung <joyeec9h3@gmail.com>2019-01-16 22:58:04 +0800
commit84e90decd508afc2e2d53b475258ae4ec36ea586 (patch)
tree2510e602f4514a9ca4a727920f07841c3637ecee /src
parent391f839563363690eba9949a7ea3607f50b04d9c (diff)
downloadandroid-node-v8-84e90decd508afc2e2d53b475258ae4ec36ea586.tar.gz
android-node-v8-84e90decd508afc2e2d53b475258ae4ec36ea586.tar.bz2
android-node-v8-84e90decd508afc2e2d53b475258ae4ec36ea586.zip
src: reset `StopTracingAgent()` before platform teardown
This makes sure that `StopTracingAgent()` is always called before tearing down the `tracing::Agent`, since previously its destructor might have tried to access the agent, which would be destroyed by the (earlier) `Dispose()` call. PR-URL: https://github.com/nodejs/node/pull/25472 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Minwoo Jung <minwoo@nodesource.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/node.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/node.cc b/src/node.cc
index 7ddf36681b..d9cb4f9be7 100644
--- a/src/node.cc
+++ b/src/node.cc
@@ -240,6 +240,7 @@ static struct {
}
void Dispose() {
+ StopTracingAgent();
platform_->Shutdown();
delete platform_;
platform_ = nullptr;
@@ -579,7 +580,6 @@ static void WaitForInspectorDisconnect(Environment* env) {
void Exit(const FunctionCallbackInfo<Value>& args) {
Environment* env = Environment::GetCurrent(args);
WaitForInspectorDisconnect(env);
- v8_platform.StopTracingAgent();
int code = args[0]->Int32Value(env->context()).FromMaybe(0);
env->Exit(code);
}
@@ -1477,7 +1477,6 @@ int Start(int argc, char** argv) {
per_process::v8_initialized = true;
const int exit_code =
Start(uv_default_loop(), args, exec_args);
- v8_platform.StopTracingAgent();
per_process::v8_initialized = false;
V8::Dispose();